public UIElement(String name, Sprite image, Vector2 position) { _name = name; _image = image; _position = position; _rightClick = UIManager.RightClickEvent; _leftClick = UIManager.LeftClickEvent; _image.Position = _position; _size = _image.Size; }
public UIEventListener(List <GlobalEvent> events, List <CommandEvent> cevents) { RightClickEvent = UIManager.RightClickEvent; LeftClickEvent = UIManager.LeftClickEvent; RightClickEvent.Handler += new UIEventHandler(RightClickHandler); LeftClickEvent.Handler += new UIEventHandler(LeftClickHandler); foreach (GlobalEvent e in events) { switch (e.Name) { case GlobalEvent.EVENTNAME.JOINGAME: _JoinGame = e; break; case GlobalEvent.EVENTNAME.CREATEGAME: _CreateGame = e; break; case GlobalEvent.EVENTNAME.STARTGAME: _StartGame = e; break; case GlobalEvent.EVENTNAME.ENDGAME: _EndGame = e; break; default: break; } } foreach (CommandEvent e in cevents) { switch (e.Name) { case CommandEvent.EVENTNAME.ADD: _AddEvent = e; break; default: break; } } }
static UIManager() { RightClickEvent = new RightClick(); LeftClickEvent = new LeftClick(); }