public void addEvent(EventObject obj) { try { events.Add(obj.Name, obj); } catch (Exception e) { Log.getInstance().log("@Folder:Events, Class:EventMap, Log Type: Error, Line No: 33, " + "EventMap could not add event object" + obj.Name + " " + e.ToString()); } }
public void convert(ObjectSpace objects) { IEnumerator<xmlObject> iter = objects.getIter(); String temp; float x, y; while (iter.MoveNext()) { EventObject obj = new EventObject(); x = -1; y = -1; temp = iter.Current.findValueOfProperty("name"); if (temp != null) { obj.Name = temp; } temp = iter.Current.findValueOfProperty("script_file"); if (temp != null) { obj.ScriptFile = temp; } temp = iter.Current.findValueOfProperty("x"); if (temp != null) { x = (float)Convert.ToDouble(temp); } temp = iter.Current.findValueOfProperty("y"); if (temp != null) { y = (float)Convert.ToDouble(temp); } if ((x > -1) && (y > -1)) { obj.Pos = new Vector2(x, y); } temp = iter.Current.findValueOfProperty("width"); if (temp != null) { obj.Width = Convert.ToInt32(temp); } temp = iter.Current.findValueOfProperty("height"); if (temp != null) { obj.Height = Convert.ToInt32(temp); } temp = iter.Current.findValueOfProperty("trigger"); if (temp != null) { obj.Triggered = (Trigger)Convert.ToInt32(temp); } events.Add(obj.Name, obj); } }