Esempio n. 1
0
 public Drafter(CubeDraft draft, CubeDraftPlayer player, int position, DraftCollection draftCollection)
 {
     QueuedPicks.Enqueue(draftCollection.GetNextPack().Cards.ToList());
     DraftId    = draft.Id;
     PlayerId   = player.Id;
     UserId     = player.MtgoLink.UserId;
     PlayerName = player.MtgoLink.User.TwitchUsername;
     Position   = position;
     Packs      = draftCollection;
     _isTimed   = draft.Timed;
 }
Esempio n. 2
0
        public void OpenNextPack()
        {
            lock (_lockObject)
            {
                if (CurrentPicks != null)
                {
                    Console.WriteLine("Current Picks Count: " + CurrentPicks.Count + " (" + String.Join(", ", CurrentPicks) + ")");
                    throw new InvalidOperationException("Cannot open next pack as invalid number of cards queued.");
                }

                var pack = Packs.GetNextPack();

                if (pack == null)
                {
                    throw new InvalidOperationException("No packs to open");
                }

                QueuedPicks.Enqueue(pack.Cards.ToList());
                NotifyPick();
            }
        }
Esempio n. 3
0
        public Drafter(CubeDraft draft, CubeDraftPlayer player, int position, DraftCollection draftCollection, List <Card> picks)
        {
            if (picks == null)
            {
                picks = new List <Card>();
            }

            DraftId    = draft.Id;
            PlayerId   = player.Id;
            UserId     = player.MtgoLink.UserId;
            PlayerName = player.MtgoLink.User.TwitchUsername;
            Position   = position;
            _isTimed   = draft.Timed;
            Packs      = draftCollection;
            if (picks.Count == 0)
            {
                QueuedPicks.Enqueue(draftCollection.GetNextPack().Cards.ToList());
            }

            Picks       = picks;
            CurrentPick = picks.Count + 1;
        }