public void UpdateLean(Llama player, Wolf dictator) { float dictatorResult = Ideals.CompareIdeals(this.Ideals, dictator.Ideals); float playerResult = Ideals.CompareIdeals(this.Ideals, player.Ideals); _lean = playerResult - dictatorResult; }
public static float CompareIdeals(Ideals sheep, Ideals other) { float result = 0; foreach (IdealType idealType in sheep.idealsDict.Keys) { if (sheep.idealsDict[idealType] > 0) { if (other.idealsDict[idealType] >= sheep.idealsDict[idealType]) { result++; } } else { if (other.idealsDict[idealType] <= sheep.idealsDict[idealType]) { result++; } } } return(result); }
protected virtual void Awake() { _ideals = new Ideals(); }