コード例 #1
0
ファイル: KeybordCommand.cs プロジェクト: Fox0074/RogueGame
        static private void GameCommand(ConsoleKey key)
        {
            switch (key)
            {
            case ConsoleKey.UpArrow:
                ActionControl.MoveCommand(direction.up);
                break;

            case ConsoleKey.DownArrow:
                ActionControl.MoveCommand(direction.down);
                break;

            case ConsoleKey.RightArrow:
                ActionControl.MoveCommand(direction.right);
                break;

            case ConsoleKey.LeftArrow:
                ActionControl.MoveCommand(direction.left);
                break;

            case ConsoleKey.I:
                gameState = GameState.inventory;
                ViewOnConsole.View(gameState);
                break;
            }
        }
コード例 #2
0
        static public void DistributeCommand(ConsoleKey key)
        {
            switch (key)
            {
            case ConsoleKey.UpArrow:
                ActionControl.MoveCommand(direction.up);
                break;

            case ConsoleKey.DownArrow:
                ActionControl.MoveCommand(direction.down);
                break;

            case ConsoleKey.RightArrow:
                ActionControl.MoveCommand(direction.right);
                break;

            case ConsoleKey.LeftArrow:
                ActionControl.MoveCommand(direction.left);
                break;

            case ConsoleKey.I:
                ActionControl.ShowInventory();
                break;
            }
        }