private void Adjustment(ITrait thisTrait, ITrait thatTrait, ref int adjustment) { var key = new KeyValuePair <int, int>(thisTrait.GetHashCode(), thatTrait.GetHashCode()); int adj = 0; m_tableTraitRelationshipAdjustment.TryGetValue(key, out adj); adjustment += adj; }
public void RegisterTraitRelation(ITrait thisTrait, ITrait thatTrait, int effect) { if (!m_allTraits.ContainsKey(thisTrait.ToString())) { m_allTraits.Add(thisTrait.ToString(), thisTrait); } if (!m_allTraits.ContainsKey(thatTrait.ToString())) { m_allTraits.Add(thatTrait.ToString(), thatTrait); } var key = new KeyValuePair <int, int>(thisTrait.GetHashCode(), thatTrait.GetHashCode()); m_tableTraitRelationshipAdjustment.Add(key, effect); }