Example #1
0
        public void UsePartyDie(CompanionType companion)
        {
            // TODO: Consider using this method everywhere Dice need to be moved from party to graveyard
            // first check if we have a companion that was transformed from a monster
            bool companionFromEnemyRemoved = PartyDice.RemoveFirst(d => d.IsFromMonster && d.Companion == companion);

            if (companionFromEnemyRemoved)
            {
                return;
            }

            // now let's check if we have a companion that was from hero ability or treasure

            bool companionFromTreasureRemoved = PartyDice.RemoveFirst(d => d.IsFromTreasureOrHeroAbility && d.Companion == companion);

            if (companionFromTreasureRemoved)
            {
                return;
            }
            // player didnt have a companion of this type that came from treasure, let's remove a normal die
            var partyDie = PartyDice.First(d => d.Companion == companion);

            PartyDice.Remove(partyDie);
            Graveyard++;
        }