예제 #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));
 }
예제 #2
0
 public Vector CountVector()
 => OptionalItems.Select(i => (double)Counter[i]).ToArray().ToVector();
예제 #3
0
 public void Enqueue(T item)
 {
     Debug.Assert(OptionalItems.Contains(item));
     Queue.Enqueue(item);
     Counter[item]++;
 }