예제 #1
0
파일: Card.cs 프로젝트: LasmGratel/UnoSharp
 public static Card Generate(Predicate <Card> predicate)
 {
     while (true)
     {
         var card = CardsPool.PickOne();
         if (predicate(card))
         {
             return(card);
         }
     }
 }
예제 #2
0
 private void MakeSingleton()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
예제 #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;
 }
예제 #4
0
파일: Card.cs 프로젝트: LasmGratel/UnoSharp
 public static Card Generate()
 {
     return(CardsQueue.Any() ? CardsQueue.Dequeue() : CardsPool.PickOne());
 }
예제 #5
0
 public static Card Generate()
 {
     return(CardsPool.PickOne());
 }