Exemplo n.º 1
0
    private static void SetAttribute(UnitAttributesData.AttributeType type, float value)
    {
        HeroData heroData = CurrentHeroData;

        Print($"{type} set from {heroData?.UnitData.Attributes.GetAttribute(type).Value} to {value}");
        heroData?.UnitData.Attributes.GetAttribute(type).Reset(value);
    }
Exemplo n.º 2
0
 private bool IsValidAttributeTypeToUpgrade(UnitAttributesData.AttributeType type)
 {
     return
         (type == UnitAttributesData.AttributeType.Strength ||
          type == UnitAttributesData.AttributeType.Dexterity ||
          type == UnitAttributesData.AttributeType.Intelligence);
 }
Exemplo n.º 3
0
    private void SpendAttributePoint(UnitAttributesData.AttributeType type)
    {
        if (unspentAttributePoints == 0)
        {
            return;
        }
        int id = GetIdOfAttributeType(type);

        spentAttributePoints[id]++;
        unspentAttributePoints--;
    }
Exemplo n.º 4
0
    private void UnspendAttributePoint(UnitAttributesData.AttributeType type)
    {
        int id = GetIdOfAttributeType(type);

        if (spentAttributePoints[id] == 0)
        {
            return;
        }
        spentAttributePoints[id]--;
        unspentAttributePoints++;
    }
Exemplo n.º 5
0
 private int GetIdOfAttributeType(UnitAttributesData.AttributeType type)
 {
     for (int i = 0; i < attributeTypes.Count; i++)
     {
         if (attributeTypes[i] == type)
         {
             return(i);
         }
     }
     Debug.Assert(false);
     return(-1);
 }
Exemplo n.º 6
0
 public static string GetName(UnitAttributesData.AttributeType type)
 {
     return(data[(int)type].name);
 }
Exemplo n.º 7
0
 public Attribute GetAttribute(UnitAttributesData.AttributeType type)
 {
     return(attributes.GetAttribute(type));
 }