public int DrawCard() { activeCard = mainDeck.Pop(); switch ((CardType)activeCard) { case CardType.MONSTER: MonsterLogic monsterLogic = new MonsterLogic(); monsterLogic.EncounterRandomMonster(hero.getLevel()); cardLogic = monsterLogic; break; case CardType.POTION: potionLogic.DiscoverPotion(); cardLogic = potionLogic; break; case CardType.ITEM: ItemLogic itemLogic = new ItemLogic(); itemLogic.GenerateItem(hero.getLevel()); cardLogic = itemLogic; break; case CardType.OPAL: cardLogic = new OpalLogic(); break; case CardType.MERCHANT: MerchantLogic merchantLogic = new MerchantLogic(); merchantLogic.GenerateItems(hero.getLevel()); cardLogic = merchantLogic; break; case CardType.BLACKSMITH: BlacksmithLogic blacksmithLogic = new BlacksmithLogic(); blacksmithLogic.SetReforgeableItems(hero); cardLogic = blacksmithLogic; break; case CardType.THIEF: cardLogic = new ThiefLogic(); break; case CardType.WELL: cardLogic = new WellLogic(); break; case CardType.GRAVE: cardLogic = new GraveLogic(); break; case CardType.GAMBLER: cardLogic = new GamblerLogic(); break; case CardType.PASSERBY: cardLogic = new PasserbyLogic(mainDeck); break; case CardType.RESCUED: cardLogic = new RescuedLogic(); break; } cardLogic.ResetStage(); persister.SaveHero(hero); return(activeCard); }