Example #1
0
    // Returns the value of this hex to the AI player. High value is good.
    public float EvaluateHexScore(Unit unit, Hex hex)
    {
        // Add the bonuses this hex gives
        float hex_score = hex.HexTerrainScoreForUnit(unit);

        // Add score based on the damage we can do to enemies from this hex
        hex_score += EnemyScoreOnHex(unit, hex);

        // Add score based on the number of allies around this hex
        hex_score += AllyScoreOnHex(unit, hex);

        return hex_score;
    }