8 public void OnAddCard(
Card c)
10 Trait trait = c.trait;
11 this.typeMap.GetOrCreate(trait.GetType(),
null).Add(c);
18 this.restSpots.Add(c);
31 public void OnRemoveCard(
Card c)
33 Trait trait = c.trait;
34 this.typeMap[trait.GetType()].Remove(c);
37 this.altars.Remove(c);
41 this.restSpots.Remove(c);
45 this.chairs.Remove(c);
54 public Thing GetRandomThing<T>() where T :
Trait
56 Card card = this.GetTraitSet<T>().RandomItem<int,
Card>();
65 public List<T> List<T>(Func<T, bool> func =
null) where T :
Trait
67 TraitSet traitSet = this.GetTraitSet<T>();
68 List<T> list =
new List<T>();
71 using (Dictionary<int, Card>.ValueCollection.Enumerator enumerator = traitSet.Values.GetEnumerator())
73 while (enumerator.MoveNext())
75 Card card = enumerator.Current;
76 list.Add(card.trait as T);
81 foreach (
Card card2
in traitSet.Values)
83 if (func(card2.trait as T))
85 list.Add(card2.trait as T);
94 return this.typeMap.GetOrCreate(typeof(T),
null);
100 return this.typeMap.GetOrCreate(t,
null);
104 public Dictionary<Type, TraitSet> typeMap =
new Dictionary<Type, TraitSet>();