2021-01-10 17:15:58 +00:00
|
|
|
using System;
|
|
|
|
|
|
|
|
public static class Score
|
|
|
|
{
|
|
|
|
private static ulong _value;
|
2021-01-11 10:01:41 +00:00
|
|
|
public static ulong Value => _value;
|
|
|
|
|
|
|
|
public static void Add(ulong val)
|
|
|
|
{
|
|
|
|
_value += val;
|
|
|
|
ScoreChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Reset()
|
2021-01-10 17:15:58 +00:00
|
|
|
{
|
2021-01-11 10:01:41 +00:00
|
|
|
_value = 0;
|
|
|
|
ScoreChanged();
|
2021-01-10 17:15:58 +00:00
|
|
|
}
|
2021-01-11 10:01:41 +00:00
|
|
|
|
|
|
|
private static void ScoreChanged()
|
|
|
|
{
|
|
|
|
ScoreUpdated?.Invoke(_value);
|
|
|
|
}
|
|
|
|
|
2021-01-10 17:15:58 +00:00
|
|
|
public static event Action<ulong> ScoreUpdated;
|
|
|
|
}
|