コード例 #1
0
ファイル: UIElement.cs プロジェクト: rdgoetz/LessThanOk
 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;
 }
コード例 #2
0
ファイル: UIEventListener.cs プロジェクト: rdgoetz/LessThanOk
        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;
                }
            }
        }
コード例 #3
0
ファイル: UIManager.cs プロジェクト: rdgoetz/LessThanOk
 static UIManager()
 {
     RightClickEvent = new RightClick();
     LeftClickEvent  = new LeftClick();
 }