Exemplo n.º 1
0
        public WritableQueue <TValue> Clone()
        {
            WritableQueue <TValue> clone = new WritableQueue <TValue>();

            clone.CopyFrom(this);
            return(clone);
        }
Exemplo n.º 2
0
        public static WritableQueue <TValue> ShuffledQueue(IEnumerable <TValue> items)
        {
            List <TValue> clonedItems = new List <TValue>(items);

            shuffle <TValue>(clonedItems);
            WritableQueue <TValue> deck = new WritableQueue <TValue>(clonedItems);

            return(deck);
        }
Exemplo n.º 3
0
        public Writable_GamePlayer(TournamentPlayer source)
        {
            this.Initialize();
            // copy the deck and keep a pointer to the strategy
            LinkedList <ReadableCard> cards = new LinkedList <ReadableCard>();

            foreach (ReadableCard readableCard in source.MainDeck)
            {
                WritableCard writableCard = readableCard.Clone((WritableCard)null);
                writableCard.ControllerID = this.GetID((Readable_GamePlayer)null);
                cards.AddLast(writableCard);
            }
            this.Deck = WritableQueue <ReadableCard> .ShuffledQueue(cards);

            this.sourcePlayer = source;
        }
Exemplo n.º 4
0
 public ReadableQueue <T> ConvertBack(WritableQueue <T> original)
 {
     return(original);
 }