private void UpdateGameStatus() { foreach (Item item in _gameTraveler.TravelersItems) { if (item.Value > 299 && item.HasValue == true) { _gameConsoleView.CanAddToInventory(); } } foreach (Item item in _gameTraveler.TravelersItems) { if (item.GameObjectID == 7) { _gameConsoleView.HasRequiredItemToEnterLocation(); } } if (_gameTraveler.TimeLocationID == 4 || _gameTraveler.TimeLocationID == 1) { _gameTraveler.HealthPoints -= 5; } if (_gameTraveler.HealthPoints == 0) { _gameConsoleView.DisplaySpawn(); } }
private void UpdateGameStatus() { foreach (Item item in _gameTraveler.TravelersItems) { if (item.Value > 299 && item.HasValue == true) { _gameConsoleView.CanAddToInventory(); } } foreach (Item item in _gameTraveler.TravelersItems) { if (item.GameObjectID == 7) { _gameConsoleView.HasRequiredItemToEnterLocation(); } } if (_gameTraveler.TimeLocationID == 4 || _gameTraveler.TimeLocationID == 1) { _gameTraveler.HealthPoints -= 7; } if (_gameTraveler.HealthPoints == 0) { _gameConsoleView.DisplaySpawn(); } foreach (Item item in _gameTraveler.TravelersItems) { if (item.GameObjectID == 8) { _gameTraveler.HoverExperience = 65; } } int a = _gameTraveler.HealthPoints; int b = 21; int result; foreach (Treasure treasure in _gameTraveler.TravelersTreasures) { if (treasure.GameObjectID == 3 || treasure.GameObjectID == 4) { if (_gameTraveler.HealthPoints < 75) { result = a + b; } } } foreach (Treasure treasure in _gameTraveler.TravelersTreasures) { if (treasure.GameObjectID == 6) { _gameTraveler.HoverExperience = 65; } } foreach (Item item in _gameTraveler.TravelersItems) { if (item.GameObjectID == 1) { if (_gameTraveler.HealthPoints < 75) { result = a + b; } } } foreach (Item item in _gameTraveler.TravelersItems) { if (item.GameObjectID == 3) { if (item is IHover) { var theItem = item as IHover; ConsoleUtil.DisplayMessage($"BatteryPower Percentage: {theItem.BatteryPower}"); } } } }