public static Card Generate(Predicate <Card> predicate) { while (true) { var card = CardsPool.PickOne(); if (predicate(card)) { return(card); } } }
private void MakeSingleton() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
private void Init() { if (_initialized) { return; } //TODO: add cards list init with iteration through CardDisplay-type children if (selectionsGroups == null) { selectionsGroups = GetComponent <SelectionsGroups>(); } if (_cardsPool == null) { _cardsPool = GetComponent <CardsPool>(); } _initialized = true; }
public static Card Generate() { return(CardsQueue.Any() ? CardsQueue.Dequeue() : CardsPool.PickOne()); }
public static Card Generate() { return(CardsPool.PickOne()); }