public void Add(ManaType type, int amount = 1, ManaRestriction restriction = null) { for (int i = 0; i < amount; i++) { this.ManaFragments.Add(ManaFragment.Get(type, restriction)); } }
public static ManaFragment Get(ManaType type, ManaRestriction restriction = null) { var key = new Tuple <ManaType, ManaRestriction>(type, restriction); ManaFragment val; if (!_dict.TryGetValue(key, out val)) { val = new ManaFragment(type, restriction); _dict[key] = val; } return(val); }
public void Add(ManaFragment f) { this.ManaFragments.Add(f); }