public void PlayersTurn() { CardAbilities cardAbilities = new CardAbilities(); // Going to need a collection of all abilities. CardAbilities is only setup for Card Actions and not taking Coin. //Move to the first players turn in the turn order array //Give the player a copy of the Abilities object. //Player picks a card ability or a turn ability. //Turn timer begins. int turnTimer = 60; //Check if player has influence. CheckPlayerInfluence(player); if (TurnOrder.Count = 1) { EndGame(Player player); } //Turn is ended and passed onto the next player in the turn order created in the GameStart. }
private void ini() { if (ctxt.Cards.Any()) { return; } var _colors = SeedColors(); Color FindColor(string name) => _colors.Where(f => f.Name.Equals(name, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); var _types = SeedTypes(); Types FindType(string name) => _types.Where(f => f.Name.Equals(name, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); var _sets = SeedSets(); Sets FindSets(string name) => _sets.Where(f => f.SetAbbr.Equals(name, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); var _abilities = SeedAbilities(); Abilities FindAbility(string ability) => _abilities.Where(a => a.Ability.Equals(ability, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); //var Sets = new Sets[] //{ // new Sets{ SetAbbr="AER", SetFullName="Aether Revolt"}, //}; //ctxt.Sets.AddRange(Sets); //ctxt.SaveChanges(true); //var types = new Types[] //{ // new Types{ ID=1, Name="Artifact Creature" }, // new Types{ ID=2, Name="Construct"} //}; //ctxt.Types.AddRange(types); //ctxt.SaveChanges(true); //var abilities = new Abilities[] //{ // new Abilities{ AbilityID =1, Ability="{4}{W}: Return another target creature you control to its owner's hand."} //}; //ctxt.Abilities.AddRange(abilities); //ctxt.SaveChanges(true); //var colors = new Color[] //{ // new Color{ Name="Colorless" } //}; //ctxt.Color.AddRange(colors); //ctxt.SaveChanges(true); var Cards = new Card[] { new Card { MultiverseID = "423808", Artist = "Kieran Yanner", CardName = "Aegis Automaton", FlavorText = "#_The streets of Ghirapur have become dangerous. It's good to have a dependable companion._#", HighPrice = 0.95, LowPrice = 0.01, MidPrice = 0.1, Power = 0, Toughness = 3, RarityId = "C", Rating = 5 } }; ctxt.Cards.AddRange(Cards); ctxt.SaveChanges(true); var CardTypes = new CardTypes[] { new MagicDbContext.Models.CardTypes { TypeID = FindType("Artifact").ID, CardID = "423808" }, new CardTypes { TypeID = FindType("Creature").ID, CardID = "423808" }, new CardTypes { TypeID = FindType("Construct").ID, CardID = "423808" } }; ctxt.CardTypes.AddRange(CardTypes); ctxt.SaveChanges(true); var Rulings = new Rulings[] { new Rulings { CardID = "423808", Ruling = "" } }; ctxt.Rulings.AddRange(Rulings); ctxt.SaveChanges(true); var cardAbilities = new CardAbilities[] { new CardAbilities { AbilityID = FindAbility("{4}{W}: Return another target creature you control to its owner's hand.").AbilityID, CardID = "423808" } }; ctxt.CardAbilities.AddRange(cardAbilities); ctxt.SaveChanges(true); var manaCosts = new ManaCosts[] { new ManaCosts { Quantity = 2, ColorID = FindColor("Colorless").ID, CardID = "423808" } }; ctxt.ManaCosts.AddRange(manaCosts); ctxt.SaveChanges(true); //ctxt.Cards.Single(s=> s.MultiverseID==423808).SetID=0; //ctxt.Cards.AddRange(Cards); ctxt.SaveChanges(true); }