<commit_before>﻿using UnityEngine;
using UnityEngine.UI;

public class GameMenu : MonoBehaviour
{
	[SerializeField] private Text _scoreLabel;
	[SerializeField] private Text _highscoreLabel;

	private IGameController gameController;

	#region MonoBehaviour

	private void OnEnable()
	{
		SetDisplayedScore(0);
		SetDisplayedHighscore(1000);
	}

	#endregion

	#region Public methods

	public void Initialize(IGameController gameController)
	{
		this.gameController = gameController;
	}

	public void SetDisplayedScore(long score)
	{
		SetScoreLabel(_scoreLabel, score);
	}

	public void SetDisplayedHighscore(long highscore)
	{
		SetScoreLabel(_highscoreLabel, highscore);
	}

	#endregion

	#region Button actions

	public void RestartButtonWasSelected()
	{
		gameController.RestartGame();
	}

	#endregion<commit_msg>Add score controller to GameMenu<commit_after>﻿using UnityEngine;
using UnityEngine.UI;

public class GameMenu : MonoBehaviour
{
	[SerializeField] private Text _scoreLabel;
	[SerializeField] private Text _highscoreLabel;

	private IGameController _gameController;
	private ScoreController _scoreController;

	#region MonoBehaviour

	private void OnEnable()
	{
		SetDisplayedScore(0);
		SetDisplayedHighscore(1000);
	}

	private void Start()
	{
		_scoreController.OnScoreUpdate += SetDisplayedScore;
		_scoreController.OnHighscoreUpdate += SetDisplayedHighscore;
	}

	private void OnDestroy()
	{
		_scoreController.OnScoreUpdate -= SetDisplayedScore;
		_scoreController.OnHighscoreUpdate -= SetDisplayedHighscore;
	}

	#endregion

	#region Public methods

	public void Initialize(IGameController gameController, ScoreController scoreController)
	{
		this._gameController = gameController;
		this._scoreController = scoreController;
	}

	public void SetDisplayedScore(long score)
	{
		SetScoreLabel(_scoreLabel, score);
	}

	public void SetDisplayedHighscore(long highscore)
	{
		SetScoreLabel(_highscoreLabel, highscore);
	}

	#endregion

	#region Button actions

	public void RestartButtonWasSelected()
	{
		_gameController.RestartGame();
	}

	#endregion
{'fraction_non_alphanumeric': 0.0749154180763654, 'fraction_numerical': 0.004833252779120348, 'mean_word_length': 5.8316831683168315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4200876', 'n_tokens_mistral': 658, 'n_tokens_neox': 618, 'n_words': 138}