private void Construct(Joystick joystick, CharactersData charactersData, IBulletSystem bulletSystem, IPrefabsCreater prefabsCreater, GameSettings gameSettings, IEndGame endGame, IPlayerHealth playerHealth) { _joystick = joystick; _navMeshAgent = GetComponent <NavMeshAgent>(); _playerHP = charactersData.PlayerData.CharacterHp; _playerSpeed = charactersData.PlayerData.CharacterSpeed; _bulletSystem = bulletSystem; _prefabsCreater = prefabsCreater; _gameSettings = gameSettings; _endGame = endGame; _playerHealth = playerHealth; _playerHealth.ChangeHealth(_playerHP); _canShoot = true; }
private void OnTriggerEnter(Collider other) { ITriggerPlayer trigger = other.GetComponent <ITriggerPlayer>(); IEndGame triggerEnd = other.GetComponent <IEndGame>(); if (trigger != null) { trigger.OnTriggerCarDetail(_nextPart, gameObject); trigger.OnTriggerObstacle(_previousPart, gameObject, _detail); } if (triggerEnd != null) { triggerEnd.OnTriggerEndGame(gameObject); triggerEnd.OnTriggerLoseObstacle(gameObject); } }
public static GameState MakeInitialGameState(List <Player> players, TurnCount totalRounds, GridSize gridSize, ICollisions iCollisions, IEndGame iEndGame) { var gameState = new GameState() { Round = 1, TotalRounds = totalRounds, GameOver = false, GridSize = gridSize, Players = new List <Player>(), Collisions = iCollisions, EndGame = iEndGame }; foreach (var player in players) { int x = RandomWrapper.RandomNumber(0, gameState.GridSize.Cols); int y = RandomWrapper.RandomNumber(0, gameState.GridSize.Rows); player.Destroyed = false; player.Position = new Position(x, y); gameState.Players.Add(player); } return(gameState); }
public void SetEnd(IEndGame end) { this.end = end; }
public EnemyRemover(IPrefabsCreater prefabsCreater, IEndGame endGame, GameSettings gameSettings) { _prefabsCreater = prefabsCreater; _gameSettings = gameSettings; _endGame = endGame; }