1 /////////////////////////////////////////////////////////////////////
2 ////subscribe(obj, func)
3 def subscribe(Object obj, Closure FunctionToCall) {
6 eventList.add("Touched")
8 functionList.add(FunctionToCall)
9 } else if (obj == location) {
13 functionList.add(FunctionToCall)
17 ////subscribe(obj, event, func)
18 def subscribe(Object obj, String event, Closure FunctionToCall) {
19 if (event == "tamper.tampered") {
20 event = "contact" //This really should be its own name
23 int dot = event.indexOf('.')
27 name = event.substring(0, dot)
28 value = event.substring(dot + 1)
35 functionList.add(FunctionToCall)
38 ////subscribe(obj, event, nameOfFunc)
39 def subscribe(Object obj, String event, String FunctionToCall) {
40 if (event == "tamper.tampered") {
41 event = "contact" //This really should be its own name
44 int dot = event.indexOf('.')
48 name = event.substring(0, dot)
49 value = event.substring(dot + 1)
56 functionList.add(FunctionToCall)
60 ////subscribe(obj, event, func, data)
61 def subscribe(Object obj, String event, Closure FunctionToCall, LinkedHashMap metaData) {
62 subscribe(obj, event, FunctionToCall)