public void CreateStartingDeck(AbilityCardDeckConfig deckConfig) { Debug.Log("Building starting Ability deck"); AbilityCardDeck = DeckFactory.CreateDeck(deckConfig.Cards); Debug.Log("Ability Deck count after build: " + AbilityCardDeck.Count); AbilityCardDeck.Emptied += OnAbilityDeckEmptied; }
protected override void Seed(BlackJack.DataAccess.ApplicationDbContext context) { // This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method // to avoid creating duplicate seed data. List <Card> deck = DeckFactory.CreateDeck(); foreach (var card in deck) { context.Cards.AddOrUpdate(card); } context.SaveChanges(); }
private void button_Click(object sender, RoutedEventArgs e) { players = new List <Player>(); currentDealerCards = new List <Card>(); currentDeck = DeckFactory.CreateDeck().Shuffle(); button.IsEnabled = false; publisher.Publish(publishTopic, Event.GameStart, TimeSpan.FromSeconds(10)); Task.Factory.StartNew(() => { Thread.Sleep(10000); Dispatcher.Invoke(HandoutCards); }); }
void Temp_SetupSinglePlayer() { var match = container.GetMatch(); match.players [0].mode = ControlModes.Local; match.players [1].mode = ControlModes.Computer; foreach (Player p in match.players) { var deck = DeckFactory.CreateDeck("DemoDeck", p.index); p [Zones.Deck].AddRange(deck); var hero = new Hero(); hero.hitPoints = hero.maxHitPoints = 30; hero.allowedAttacks = 1; hero.ownerIndex = p.index; hero.zone = Zones.Hero; p.hero.Add(hero); } }