Пример #1
0
        public static PlayerDeck CreatingPlayerHand()
        {
            List <PlayerDeck> deckWithCityAndeventCards = new List <PlayerDeck>();
            PlayerDeck        dealedCard;
            Random            rand = new Random();
            int randomNumber       = rand.Next(0, 6);

            deckWithCityAndeventCards = deckWithCityAndeventCards.Concat(PlayerCardDeck.CreateCityCardDeck()).Concat(PlayerCardDeck.AddingEventCards()).ToList();

            dealedCard = deckWithCityAndeventCards[randomNumber];
            deckWithCityAndeventCards.RemoveAt(randomNumber);

            return(dealedCard);
        }
Пример #2
0
        /// <summary>
        /// Desteden kart çeker eğer elinde 5 kartan az varsa eline alır yoksa yok eder
        /// </summary>
        public void DrawCard()
        {
            if (!PlayerCardDeck.Any())
            {
                return;
            }

            var random      = new Random();
            var drawingCard = PlayerCardDeck[random.Next(0, PlayerCardDeck.Count)];

            PlayerCardDeck.Remove(drawingCard);
            if (PlayerHandCards.Count < 5)
            {
                PlayerHandCards.Add(drawingCard);
            }
        }
 void Awake()
 {
     Instance     = this;
     pDeck        = PlayerCardDeck.Instance;
     spawnManager = SpawnManager.Instance;
 }
Пример #4
0
 void Awake()
 {
     Instance = this;
     DontDestroyOnLoad(this);
 }