public GameCardGame(GameCardGameOptions options) { Spaces = new List<CardGameTableSpace>(); TextAreas = new List<GameCardGameTextArea>(); Answers = new List<CardGameAnswer>(); Users = new List<CardGameUser>(); NumberOfCards = options.NumberOfCards == 0 ? 52 : options.NumberOfCards; NumberOfJokers = options.NumberOfJokers == 0 ? 52 : options.NumberOfJokers; Deck = new CardGamePile("deck"); for (var i = 0; i < NumberOfCards; i++) { Deck.Cards.Add(new CardGameCard(i % 13, (int) Math.Floor(i / 13))); } for (var i = 0; i < NumberOfJokers; i++) { Deck.Cards.Add(new CardGameCard(0, 0)); } Size = options.Size ?? new Size(15, 15); /* this.setAnswers = function (answers) { this.answers = answers; }; */ }
public GameCardGame( ) { Spaces = new List<CardGameTableSpace>(); TextAreas = new List<GameCardGameTextArea>(); EmulatedAnswers = new List<CardGameAnswer>(); Users = new List<CardGameUser>(); Effects = new List<CardGameEffect>(); Deck = new CardGamePile("deck"); }
public CardGameTableSpace(CardGameTableSpaceOptions options) { Vertical = !options.Vertical ? false : options.Vertical; X = options.X == 0 ? 0 : options.X; Y = options.Y == 0 ? 0 : options.Y; Name = options.Name ?? "TableSpace"; Width = options.Width == 0 ? 0 : options.Width; Height = options.Height == 0 ? 0 : options.Height; //Rotate = options.Rotate == 0 ? 0 : options.Rotate; Visible = !options.Visible ? true : options.Visible; StackCards = !options.StackCards ? false : options.StackCards; Pile=new CardGamePile(Name+"Pile"); SortOrder = options.SortOrder; NumberOfCardsHorizontal = options.NumerOfCardsHorizontal == 0 ? 1 : options.NumerOfCardsHorizontal; NumberOfCardsVertical = options.NumerOfCardsVertical == 0 ? 1 : options.NumerOfCardsVertical; ResizeType = options.ResizeType; //Rotate = ExtensionMethods.eval("options.rotate? options.rotate : 0"); Effects=new List<string>(); }
public CardGameTableSpace AssignPile(CardGamePile pile) { Pile = pile; PileName = pile.Name; return this; }
public CardGameUser(string name) { UserName = name; Cards = new CardGamePile(name); }