Esempio n. 1
0
    public static IEnumerable <HexAIMove> GenerateAllValidMoves(Game game)
    {
        var        state         = game.turnHistory[game.turnHistory.Count - 1];
        BoardState previousState = game.turnHistory.Count > 1
            ? game.turnHistory[game.turnHistory.Count - 2]
            : default;

        foreach (var move in MoveGenerator.GenerateAllValidMoves(state.currentMove, game.promotions, state, previousState))
        {
            yield return(new HexAIMove(move.start, move.target, move.moveType, move.promoteTo));
        }
    }