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); }
private bool IsValidAttributeTypeToUpgrade(UnitAttributesData.AttributeType type) { return (type == UnitAttributesData.AttributeType.Strength || type == UnitAttributesData.AttributeType.Dexterity || type == UnitAttributesData.AttributeType.Intelligence); }
private void SpendAttributePoint(UnitAttributesData.AttributeType type) { if (unspentAttributePoints == 0) { return; } int id = GetIdOfAttributeType(type); spentAttributePoints[id]++; unspentAttributePoints--; }
private void UnspendAttributePoint(UnitAttributesData.AttributeType type) { int id = GetIdOfAttributeType(type); if (spentAttributePoints[id] == 0) { return; } spentAttributePoints[id]--; unspentAttributePoints++; }
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); }
public static string GetName(UnitAttributesData.AttributeType type) { return(data[(int)type].name); }
public Attribute GetAttribute(UnitAttributesData.AttributeType type) { return(attributes.GetAttribute(type)); }