示例#1
0
        private bool onPreviousActionCommand(CommandBase command)
        {
            Console.WriteLine("onPreviousActionCommand");

            if (command is PreviousActionCommand)
            {
                PreviousActionCommand previousActionCommand = command as PreviousActionCommand;

                if (previousActionCommand.IsEnemyAi)
                {
                    //judge has my chessType
                    if (Model.GetBoard().Any(x => x.Any(y => y == MyChessType)))
                    {
                        //todo hard code
                        Player.TotalTurn -= 2;
                        Model.PreviousAction();
                        Model.PreviousAction();
                        View.RemoveLastChess();
                        View.RemoveLastChess();
                        RoleMgr.PreviousPlayerByJudgeContainAI();
                    }
                    else
                    {
                        Console.WriteLine("Not exit my chess,cant regret");
                    }
                }
                else
                {
                    Player.TotalTurn--;
                    Model.PreviousAction();
                    View.RemoveLastChess();
                    RoleMgr.PreviousPlayerByJudge();
                }

                return(true);
            }
            else
            {
                Console.WriteLine("command is not PreviousActionCommand");
                return(false);
            }
        }