using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UIElements; using Random = System.Random; /// /// gameplay behaviour class /// public class Gameplay { /// /// countdown text label for showing the countdown /// private readonly Label _countdownText; /// /// list of played rounds /// private readonly List _playedRounds = new(5); /// /// response colour for the player to match /// private readonly VisualElement _responseColour; /// /// round text label for showing the current round /// private readonly Label _roundText; /// /// template colour for the player to match /// private readonly VisualElement _templateColour; /// /// game countdown timer /// private DateTime _countdownDatetime; /// /// game round counter /// public int Round = -1; /// /// singleton instance of the gameplay class /// private const int RoundsPerGame = 5; /// /// seconds per round /// private const double SecondsPerRound = 15d; /// /// constructor for the gameplay class /// /// the visual element object for the ui document with the GameView public Gameplay(VisualElement ui) { _roundText = ui.Q