Example #1
0
 public static bool Compare(WeightedObjective a, WeightedObjective b)
 {
     if (a.weight < b.weight)
     {
         return false;
     }
     return true;
 }
Example #2
0
    /// <summary>
    /// takes the objective and sets it's weight based on the distance it is from the AI and on how important it is based on difficulty
    /// </summary>
    /// <param name="objective">the Objective</param>
    float ModifyWeight(WeightedObjective objective)
    {
        float newWeight = 1.0f;
        switch(objective.obj.tag)
        {
            case "Player":
                newWeight = CalculateWeight(playerWeight, objective.obj);
                break;

        /*
            case "Asteroid":
                newWeight = CalculateWeight(itemWeight, objective.obj);
                break;
        */

            case "Collectable":
                newWeight = CalculateWeight(itemWeight, objective.obj);
                break;

            case "ItemSpawner":
                newWeight = CalculateWeight(areaWeight, objective.obj);
                break;
        }
        return newWeight;
    }