public WritableQueue <TValue> Clone() { WritableQueue <TValue> clone = new WritableQueue <TValue>(); clone.CopyFrom(this); return(clone); }
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); }
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; }
public ReadableQueue <T> ConvertBack(WritableQueue <T> original) { return(original); }