Esempio n. 1
0
    protected void SetMoveDirection(EMoveDir dir)
    {
        switch (dir)
        {
        case EMoveDir.Top: movePos = Global.Inst.UI_MOVE_TOP; break;

        case EMoveDir.Bottom: movePos = Global.Inst.UI_MOVE_BOTTOM; break;

        case EMoveDir.Left: movePos = Global.Inst.UI_MOVE_LEFT; break;

        case EMoveDir.Right: movePos = Global.Inst.UI_MOVE_RIGHT; break;
        }
    }
Esempio n. 2
0
        public bool move(EMoveDir direction)
        {
            int[,] old = new int[boardSize, boardSize];
            Array.Copy(boardData, 0, old, 0, boardData.Length);
            for (int x = 0; x < boardSize; x++)
            {
                switch (direction)
                {
                case EMoveDir.moveUp:
                    moveUp(x);
                    break;

                case EMoveDir.moveRight:
                    moveRight(x);
                    break;

                case EMoveDir.moveDown:
                    moveDown(x);
                    break;

                case EMoveDir.moveLeft:
                    moveLeft(x);
                    break;
                }
            }
            bool flag = place2();

            for (int x = 0; x < boardSize; x++)
            {
                for (int y = 0; y < boardSize; y++)
                {
                    if (old[x, y] != boardData[x, y])
                    {
                        refreshCell(x, y, boardData[x, y]);
                    }
                }
            }
            return(flag);
        }