예제 #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(),
     });
 }
예제 #2
0
 internal static IList <PolyPlayedPiece> Create(BoardModel board)
 {
     return(board.PlayedPieceLookup
            .Select(p => PolyPlayedPiece.Create(p.Key, p.Value)).ToList());
 }