private void MovePlayer(string command) { if (HeroController == null || EnemyController == null || MapController == null) { return; } Point newCoordinate = HeroController.GetNextCoordinate(command); if (MapController.CanMove(newCoordinate)) { if (MapController.SameRoom(HeroController.Player.Coordinate, EnemyController.Character.Coordinate)) { HeroController.RemoveHealth(); Console.WriteLine("You lost 1 health. Now you has " + HeroController.Player.Health + " left."); } HeroController.Move(newCoordinate); if (EnemyController.CanMove()) { var nextEnemyMove = MapController.GetNextEnemyCoordinate(newCoordinate, EnemyController.Character.Coordinate); EnemyController.Move(nextEnemyMove); } MapController.Print(HeroController.Player.Coordinate, EnemyController.Character.Coordinate); if (MapController.NextRoom(HeroController.Player.Coordinate, EnemyController.Character.Coordinate)) { Console.WriteLine("The enemy is close to you!"); } else if (MapController.SameRoom(HeroController.Player.Coordinate, EnemyController.Character.Coordinate)) { if (HeroController.Player.Bag.Items.Count > 0 && HeroController.Player.Bag.Items[0].Type == Item.ItemType.Sword) { EnemyController.Dead = true; Console.WriteLine("You killed the enemy with the Sword. You are free to go."); } else { Console.WriteLine("The enemy is in front of you. You have no Sword, RUN!."); } } } else { Console.WriteLine("There is a wall here!"); } }