Ejemplo n.º 1
0
 internal static PolyChoice Create(Choice choice, int depth)
 {
     return(new PolyChoice {
         _choice = choice,
         Depth = depth,
         Player = choice.TurnPlayer.Value,
         LastPlayer = choice.LastTurnPlayer.Value,
         IsDone = choice.IsDone,
         Weight = choice.Weight,
         Result = choice.Board.Result,
         PlayedPieces = PolyPlayedPiece.Create(choice.Board),
         PlayedMove = choice.Board.LastMove == null ? null
   : PolyMove.Create(0, choice.Board.LastMove),
         ChosenMove = choice.Board.LegalMoves.Count == 0 ? null
   : PolyMove.Create(choice.BestIndex, choice.Board.LegalMoves[choice.BestIndex]),
         Played = choice.Board.PlayedPieceLookup
                  .Select(p => PolyPlayedPiece.Create(p.Key, p.Value)).ToList(),
     });
 }
Ejemplo n.º 2
0
 // enquiries
 public PolyMove GetLegalMove(int index)
 {
     return((index >= 0 && index < LegalMoves.Count) ? LegalMoves[index]
 : PolyMove.Create(index, null));
 }