Example #1
0
    protected IEnumerator RequestMoveCoroutine()
    {
        possibleMoveAmount = -1;
        heatMap            = new HeatMap(game.board.size);
        for (Position position = new Position(0, 0); position.x < game.board.size.x; ++position.x)
        {
            for (position.y = 0; position.y < game.board.size.y; ++position.y)
            {
                if (game.board.GetState(position) == 0)
                {
                    ++possibleMoveAmount;
                    yield return(Evaluate(position));
                }
                else
                {
                    heatMap.SetHeat(position, float.MinValue);
                }
            }
        }
        Position move = heatMap.GetHottestPosition();

        game.DoMove(heatMap.GetHottestPosition());
    }