Exemplo n.º 1
0
 /// <summary>
 /// general fonction to move
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Inner_moveTo(object sender, MoveToEventArgs e)
 {
     if (e.page.Equals("BuildingNew"))
     {
         ((VMBuilding)ViewModels.ElementAt((int)InnerDecksView.BUILDING)).Clear();
         e.page = "Building";
     }
     this.move_To(e.page);
 }
Exemplo n.º 2
0
        private void CreateRoom(object param)
        {
            MoveToEventArgs e = new MoveToEventArgs("CreateRoom");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 3
0
        private void leaveTheRoom()
        {
            MoveToEventArgs args = new MoveToEventArgs("Rooms");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
            {
                handler(this, args);
            }
        }
Exemplo n.º 4
0
        private void Back(object param)
        {
            MoveToEventArgs args = new MoveToEventArgs("Decks");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
            {
                handler(this, args);
            }
        }
Exemplo n.º 5
0
        private void iAmReady(object param)
        {
            MoveToEventArgs e = new MoveToEventArgs("Game");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 6
0
        private void modifyEvent(object param)
        {
            MoveToEventArgs e = new MoveToEventArgs("ModifyEvent");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// event click build new deck
        /// </summary>
        /// <param name="param"></param>
        private void buildNew(object param)
        {
            MoveToEventArgs args = new MoveToEventArgs("BuildingNew");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
            {
                handler(this, args);
            }
        }
Exemplo n.º 8
0
        private void cancelRoom(object param)
        {
            MoveToEventArgs e = new MoveToEventArgs("Rooms");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            errVisibility = Visibility.Hidden;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// return to home view
        /// </summary>
        /// <param name="param"></param>
        private void goHome(object param)
        {
            setEvent(String.Empty, String.Empty, String.Empty, String.Empty);
            errMess = String.Empty;
            MoveToEventArgs e = new MoveToEventArgs("Home");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 10
0
        void r_DERO(object sender, serverReturnEventArgs e)
        {
            if (e.data.Contains("OK"))
            {
                MoveToEventArgs args = new MoveToEventArgs("Rooms");
                EventHandler <MoveToEventArgs> handler = this.getMoveTo();

                if (handler != null)
                {
                    handler(this, args);
                }
            }
        }
Exemplo n.º 11
0
        /*
         * This function release the event with the good argument.
         */
        private void disconnection(object param)
        {
            /*
             * putting the home screen as default screen for next connexion
             */
            move_To("Home");

            /*
             * go back to log screen
             */
            MoveToEventArgs e = new MoveToEventArgs("logIn");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 12
0
        void component_MoveTo(object sender, MoveToEventArgs e)
        {
            if (!_currentComponent.MovingNextFromComponent())
            {
                return;
            }
            UnsetComponenet(_currentComponent);
            _currentComponent = e.Component;

            if (_currentComponent == null)
            {
                Environment.Exit(0);
            }
            else
            {
                SetComponent(_currentComponent);
            }
        }
Exemplo n.º 13
0
        void r_SGNI(object sender, serverReturnEventArgs e)
        {
            if (e.data.Contains("OK"))
            {
                password = "";
                MoveToEventArgs m = new MoveToEventArgs("InnerBoard");
                EventHandler <MoveToEventArgs> handler = this.getMoveTo();

                if (handler != null)
                {
                    handler(this, m);
                }
            }
            else
            {
                this.message = "Log in failed.";
            }
        }
Exemplo n.º 14
0
        void r_JORO(object sender, serverReturnEventArgs e)
        {
            if (e.data.Contains("OK"))
            {
                RoomEventArgs rargs = new RoomEventArgs(selectedRoom);
                if (roomJoin != null)
                {
                    roomJoin(this, rargs);
                }

                MoveToEventArgs args = new MoveToEventArgs("Room");
                EventHandler <MoveToEventArgs> handler = this.getMoveTo();

                if (handler != null)
                {
                    handler(this, args);
                }
            }
        }
Exemplo n.º 15
0
        void r_CNRO(object sender, serverReturnEventArgs e)
        {
            if (!e.data.Contains("KO"))
            {
                Room          created = new Room(int.Parse(e.data), name, Format, RoomName, 0);
                RoomEventArgs rargs   = new RoomEventArgs(created);
                if (roomCreation != null)
                {
                    roomCreation(this, rargs);
                }


                MoveToEventArgs args = new MoveToEventArgs("Room");
                EventHandler <MoveToEventArgs> handler = this.getMoveTo();

                if (handler != null)
                {
                    handler(this, args);
                }
            }
        }
Exemplo n.º 16
0
        void r_RSET(object sender, serverReturnEventArgs e)
        {
            Application.Current.Dispatcher.Invoke(new Action(delegate()
            {
                Deck.Clear();
                Hand.Clear();
                MyBoard.Clear();
                OppBoard.Clear();
                Exile.Clear();
                Grave.Clear();
                MYPV  = 20;
                HISPV = 20;
            }), null);
            MoveToEventArgs args = new MoveToEventArgs("Room");
            EventHandler <MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
            {
                handler(this, args);
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// 人物的移动方向
        /// </summary>
        /// <param name="d"></param>
        /// <returns></returns>
        public bool MoveTo(Point3D newLocation)
        {
            BaseMap tempMap = m_Map; // 副本防止多线程置空

            if (m_Deleted == true || tempMap == null)
            {
                return(false);
            }

            MoveToEventArgs eventArgs = GlobalEvent.BaseCharacter.InvokeMoveTo(newLocation, this);

            if (eventArgs != null)
            {
                if (eventArgs.Blocked == true)
                {
                    return(false);
                }
            }

            Point3D oldLocation = (Point3D)m_Location;

            if (m_GameEntityState != null)
            {
                if (m_GameEntityState.OnMovingTo(newLocation, this) == true)
                {
                    return(false);
                }
            }

            this.Location = newLocation; // 间接设置
            tempMap.OnMove(oldLocation, this);
            m_GameEntityState.IsMoveToCall = true;

            if (m_GameEntityState != null)
            {
                m_GameEntityState.OnMovedTo(oldLocation, this);
            }

            return(true);
        }
Exemplo n.º 18
0
 void Game_BeforeMoveTo(object sender, MoveToEventArgs e)
 {
 }
Exemplo n.º 19
0
 void Game_AfterMoveTo(object sender, MoveToEventArgs e)
 {
     KibitzerManager.SendMoveToKibitzer(e.Move);
 }
Exemplo n.º 20
0
 private void Inner_moveTo(object sender, MoveToEventArgs e)
 {
     this.move_To(e.page);
 }
Exemplo n.º 21
0
 /*
  * event for navigation
  */
 private void Switcher_moveTo(object sender, MoveToEventArgs e)
 {
     this.moveTo(e.page);
 }