public ActionManager(ChessBoard board) { this.board = board; buildedData.Rebuild(board); actionTeam = ChessTeam.White; actionState = new UnselectedState(this); }
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(); } } }