예제 #1
0
        public CombatResult Battle([FromBody] BattleModel battleModel)
        {
            var attacker = _monsterCardEntityCrud.GetOne(battleModel.AttackerId);
            var defender = _monsterCardEntityCrud.GetOne(battleModel.DefenderId);

            return(BattleCalculator.Attacks((MonsterCard)attacker.CardReference, (MonsterCard)defender.CardReference));
        }
        public ICombatResult Battle(string attackerId, string defenderId, int attackingSide = 1)
        {
            IMonsterCard attacker = GetAttacker(attackerId, attackingSide);
            IMonsterCard defender = GetDefender(defenderId, attackingSide);

            return(BattleCalculator.Attacks((MonsterCard)attacker, (MonsterCard)defender));
        }