Beispiel #1
0
 /// <summary>
 /// Returns the named blueprint if it is this one or exists amongst the <see cref="MandatoryActors"/>, <see cref="MandatoryItems"/> etc
 /// </summary>
 public override HasStatsBlueprint TryGetBlueprint(string name)
 {
     return(base.TryGetBlueprint(name) ??
            MandatoryActors.Select(a => a.TryGetBlueprint(name)).FirstOrDefault(b => b != null) ??
            MandatoryItems.Select(a => a.TryGetBlueprint(name)).FirstOrDefault(b => b != null) ??
            OptionalActors.Select(a => a.TryGetBlueprint(name)).FirstOrDefault(b => b != null) ??
            (HasStatsBlueprint)OptionalItems.Select(a => a.TryGetBlueprint(name)).FirstOrDefault(b => b != null));
 }
Beispiel #2
0
 public Vector CountVector()
 => OptionalItems.Select(i => (double)Counter[i]).ToArray().ToVector();
Beispiel #3
0
 public void Enqueue(T item)
 {
     Debug.Assert(OptionalItems.Contains(item));
     Queue.Enqueue(item);
     Counter[item]++;
 }