예제 #1
0
        public ActionResult NewRecord(PlayedDeck playedDeck)
        {
            playedDeck.Date = DateTime.Now;
            playedDeck.User = User.Identity.Name;
            var x = intelRepository.SavePlayedDeck(playedDeck, playedDeck.PlayerId);

            return(RedirectToAction("PlayerInfo", new { playerId = playedDeck.PlayerId }));
        }
        public void TestDeckSize()
        {
            PlayedDeck deck = new PlayedDeck("AAECAf0ECvsMoM4Cws4Cm9MCnOICo+sCpvACt/ECw/gCxvgCCk3JA+wHm8IC08UClscCm8sC1+ECluQC4vgCAA==");

            System.Drawing.Bitmap   bmp      = new System.Drawing.Bitmap(1, 1);
            System.Drawing.Graphics tempGr   = System.Drawing.Graphics.FromImage(bmp);
            System.Drawing.Size     drawSize = deck.DrawToGraphics(tempGr);
            Assert.IsTrue(drawSize.Equals(deck.GetSize()));
        }
예제 #3
0
        public void DefaultConstructorHasDefaultProps()
        {
            var deck = new PlayedDeck();

            Assert.AreEqual(0, deck.Turns);
            Assert.AreEqual(PlayerClass.ANY, deck.Klass);
            Assert.AreEqual(GameFormat.ANY, deck.Format);
            Assert.IsTrue(deck.Cards.Count == 0);
        }
예제 #4
0
        public async Task <FirebaseObject <string> > SavePlayedDeck(PlayedDeck playedDeck, int playerId)
        {
            var firebase = FirebaseClient();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string jsonDeck = serializer.Serialize(playedDeck);
            var    result   = await firebase.Child(playerId.ToString()).PostAsync(jsonDeck);

            return(result);
        }
예제 #5
0
 public override void ClearRound()
 {
     AddCardsToWinner();
     foreach (var user in Users)
     {
         if (user.Played != null)
         {
             PlayedDeck.Push(user.Played);
             user.Played = null;
         }
     }
     RoundWinner = null;
 }
예제 #6
0
        static void Test2Deck()
        {
            PlayedDeck        deck1    = new PlayedDeck("AAECAf0ECvsBrgPmBO0F7Ae4CPsMwcEC2sUCzesCCooBnALJA6sEywTtBJYFudECluQCpvACAA==");
            PlayedDeck        deck2    = new PlayedDeck("AAECAaoICCCZArEI88ICws4C9uwCp+4CzfQCC70B0wH+BdkH8AeRwQKswgKbywKW6AKU7wKw8AIA");
            List <PlayedDeck> deckList = new List <PlayedDeck>();

            deckList.Add(deck1);
            deckList.Add(deck2);
            PluginExample.DecksForm form = new PluginExample.DecksForm();
            form.Show();
            form.SetShowDeckList(deckList);
            form.RedrawDeck();
            form.RedrawDeck();
        }
예제 #7
0
 private void AddCardsToWinner()
 {
     if (RoundWinner != null)
     {
         if (PlayedDeck.Any())
         {
             RoundWinner.DiscardPile.AddToStackAndEmptySource(PlayedDeck);
         }
         foreach (var user in Users)
         {
             if (user.Played != null)
             {
                 RoundWinner.DiscardPile.Push(user.Played);
                 user.Played = null;
             }
         }
     }
 }
예제 #8
0
 public void Setup()
 {
     _archDeck = new ArchetypeDeck(
         "Control Warrior",
         PlayerClass.WARRIOR,
         GameFormat.STANDARD,
         ArchetypeStyles.CONTROL,
         new List <Card>()
         );
     _playDeck = new PlayedDeck("Warrior", Format.Standard, 7,
                                new List <TrackedCard>()
     {
         new TrackedCard("AB_123", 2),
         new TrackedCard("AB_124", 1),
         new TrackedCard("AB_125", 1),
         new TrackedCard("AB_126", 1),
         new TrackedCard("AB_127", 2),
         new TrackedCard("AB_128", 1)
     }
                                );
 }
예제 #9
0
        public void FindBestMatch()
        {
            _manager.AddDeck(_sample);
            _manager.AddDeck(new ArchetypeDeck(
                                 "rAmp",
                                 PlayerClass.DRUID,
                                 GameFormat.WILD,
                                 ArchetypeStyles.COMBO,
                                 new List <Card>()
            {
                new SingleCard("AB_987"),
                new SingleCard("AB_321")
            }
                                 ));
            var deck = new PlayedDeck("Druid", Format.Wild, 5, new List <TrackedCard>()
            {
                new TrackedCard("OG_129", 1),
                new TrackedCard("AT_387", 1),
                new TrackedCard("AB_321", 1),
                new TrackedCard("FP1_298", 1)
            });

            Assert.AreEqual("rAmp", _manager.Find(deck).First().Name);
        }