public bool ActionWithEnemies(string action, out bool exitAction) { exitAction = false; if (Int32.TryParse(action, out int result)) { if (result == enemies.Count()) { return(true); } else if (result == enemies.Count() + 1) { exitAction = true; return(true); } else if (result >= 0 && result < enemies.Count()) { if (FightEnemy(enemies[result])) { enemies.Remove(result); } } } return(false); }
public string ShowEnemies(EnemyCollection <BaseEnemy> baseEnemy, string name) { Console.Clear(); Console.WriteLine($"{name}\n"); int length = baseEnemy.Count(); for (int i = 0; i < length; i++) { Console.WriteLine($@"{i}. {baseEnemy[i].Name} - (Lvl {baseEnemy[i].Level}) Stats: Damage = {baseEnemy[i].Damage} Health = {baseEnemy[i].Health} Exp = {baseEnemy[i].OwnExperience} {new string('_',80)}"); } Console.WriteLine($"{length}. Refresh"); Console.Write($@"{length+1}. Back Select action: "); return(Console.ReadLine()); }