Example #1
0
    public void AddNewMatch(bool won, int moves, DateTime date, int elapsedSeconds)
    {
        LevelMatchHistory history = new LevelMatchHistory(won, moves, date, elapsedSeconds);

        History.Insert(0, history);

        node["MatchHistory"].Add(history.Serialize());
    }
Example #2
0
    public void SetMatch(LevelMatchHistory match)
    {
        date.text  = match.StartDate.ToString("yyyy-MM-dd HH:mm");
        moves.text = match.Moves.ToString();
        time.text  = match.ElapsedSeconds.ToString();

        if (match.Won)
        {
            background.color = winBackgroundColor;
        }
    }