public string Fight(string attackUser, string enemyUser) { IPlayer attacker = playerRepo.Find(attackUser); IPlayer defender = playerRepo.Find(enemyUser); battleField.Fight(attacker, defender); return($"Attack user health {attacker.Health} - Enemy user health {defender.Health}"); }
public string Fight(string attackUser, string enemyUser) { IPlayer attackPlayer = this.playerRepository.Players.FirstOrDefault(p => p.Username == attackUser); IPlayer enemyPlayer = this.playerRepository.Players.FirstOrDefault(p => p.Username == enemyUser); battleField.Fight(attackPlayer, enemyPlayer); return($"Attack user health {attackPlayer.Health} - Enemy user health {enemyPlayer.Health}"); }
public string Fight(string attackUser, string enemyUser) { var attackingPlayer = playerRepository.Find(attackUser); var enemyPlayer = playerRepository.Find(enemyUser); battleField.Fight(attackingPlayer, enemyPlayer); return(string.Format(ConstantMessages.FightInfo, attackingPlayer.Health, enemyPlayer.Health)); }
public string Fight(string attackUser, string enemyUser) { IPlayer attackPlayer = this.playerRepository.Players.FirstOrDefault(p => p.Username == attackUser); IPlayer enemyPlayer = this.playerRepository.Players.FirstOrDefault(p => p.Username == enemyUser); battleField.Fight(attackPlayer, enemyPlayer); return(string.Format(ConstantMessages.FightInfo, attackPlayer.Health, enemyPlayer.Health)); }
public string Fight(string attackUser, string enemyUser) { var attack = this.playerRepository.Find(attackUser); var enemy = this.playerRepository.Find(enemyUser); battleField.Fight(attack, enemy); var result = string.Format(ConstantMessages.FightInfo, attack.Health, enemy.Health); return(result); }