Exemple #1
0
    public ActionManager(ChessBoard board)
    {
        this.board = board;

        buildedData.Rebuild(board);
        actionTeam  = ChessTeam.White;
        actionState = new UnselectedState(this);
    }
Exemple #2
0
    void BuildCriticalMove(ChessBoard board)
    {
        var tempBuild = new BuildedData();


        for (int i = 0; i < SequenceCount; ++i)
        {
            var single = this[i];
            for (int j = 0; j < single.Count; ++j)
            {
                var action = owner.MoveTo(single[j]);


                tempBuild.Rebuild(board);


                if (tempBuild.IsChecked(owner.Team))
                {
                    single.RemoveAt(j);
                    j -= 1;
                }

                action.Undo();
            }
        }
    }