public GameLogic(StartCoroutineDelegate startCoroutine, CreateBallDelegate createBall, PlayerScoresLogic playerScoresLogic, PlayerScoresPresentation playerScoresPresentation, GameData gameData) { this.startCoroutine = startCoroutine; this.createBall = createBall; this.playerScoresLogic = playerScoresLogic; this.playerScoresPresentation = playerScoresPresentation; this.gameData = gameData; startCoroutine(GameFlow()); }
void Awake() { const int numPlayers = 2; PlayerScoresLogic = new PlayerScoresLogic(numPlayers, PlayerScoresData.PointsToWin); Text scoresText = GetComponent <Text>(); PlayerScoresPresentation = new PlayerScoresPresentation((visible) => gameObject.SetActive(visible), PlayerScoresLogic, PlayerScoresData.PointsToWin, scoresText); PlayerScoresLogic.OnScoreChanged += PlayerScoresPresentation.UpdateText; }