示例#1
0
        private void LeftClickHandler(object sender, EventArgs e)
        {
            if (sender is UIElement)
            {
                UIElement element = (UIElement)sender;
                if (element.Name == "home")
                {
                    //UIManager.The.switchFrame("home");
                }
                else if (element.Name == "end")
                {
                    _EndGame.trigger();
                }
                else if (element.Name == "join")
                {
                    Console.WriteLine("Joining Session...");
                    _JoinGame.trigger();
                }
                else if (element.Name == "create")
                {
                    Console.WriteLine("Creating Session...");
                    _CreateGame.trigger();
                }
                else if (element.Name == "start")
                {
                    _StartGame.trigger();
                }
                else if (element.Name == "ready")
                {
                }
                else if (element.Name == "add")
                {
                    _AddEvent.trigger();

                    /*
                     * if (NetworkManager.Session.IsHost)
                     * {
                     *  UInt16 builder = InputManager.Selected.ID;
                     *  UInt16 type = GameObjectFactory.The.getType("TestUnit").ID;
                     *
                     *  Command_Add cmd = new Command_Add(builder, 0, type, new TimeSpan());
                     *  RequestQueue_Server.The.push(cmd);
                     * }
                     */
                }
            }
            else
            {
            }
        }