module PSCL
module EVENT
@whouse=[]
def self.geteventname(evt)
evt.instance_variable_get("@event").instance_variable_get("@name")
end
def self.seteventxyid(evt,x,y,id)
evt.instance_variable_get("@event").instance_variable_set("@x",x)
evt.instance_variable_get("@event").instance_variable_set("@y",y)
evt.instance_variable_set("@id",id)
end
def self.search_events(amap,sid=0)
@whouse[sid] = {} if @whouse[sid] == nil
amap.events.each{|k,v|
@whouse[sid][geteventname(v)] = v
}
end
def self.put_event(amap,ename,x,y,sid=0)
ael = amap.events.length().to_s.to_i + 1
amap.events.merge!({ael => Marshal.load(Marshal.dump(@whouse[sid][ename]))})
seteventxyid(amap.events[ael],x,y,ael)
return ael
end
end
end
module PSCL
module EVENT
@whouse=[]
def self.geteventname(evt)
evt.instance_variable_get("@event").instance_variable_get("@name")
end
def self.seteventxyid(evt,x,y,id)
evt.instance_variable_get("@event").instance_variable_set("@x",x)
evt.instance_variable_get("@event").instance_variable_set("@y",y)
evt.instance_variable_set("@id",id)
end
def self.search_events(amap,sid=0)
@whouse[sid] = {} if @whouse[sid] == nil
amap.events.each{|k,v|
@whouse[sid][geteventname(v)] = v
}
end
def self.put_event(amap,ename,x,y,sid=0)
ael = amap.events.length().to_s.to_i + 1
amap.events.merge!({ael => Marshal.load(Marshal.dump(@whouse[sid][ename]))})
seteventxyid(amap.events[ael],x,y,ael)
return ael
end
end
end