Exemplo n.º 1
0
 public static Card Generate(Predicate <Card> predicate)
 {
     while (true)
     {
         var card = CardsPool.PickOne();
         if (predicate(card))
         {
             return(card);
         }
     }
 }
Exemplo n.º 2
0
 private void MakeSingleton()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 public static Card Generate()
 {
     return(CardsQueue.Any() ? CardsQueue.Dequeue() : CardsPool.PickOne());
 }
Exemplo n.º 5
0
 public static Card Generate()
 {
     return(CardsPool.PickOne());
 }