@using Sandbox; @using System @using Sandbox.UI; @namespace MurderGame @inherits Panel @if (HasTime()) {
@GetTime()
} else {
@GetPhase()
} @code { public bool HasTime() { return MurderGame.Instance.CurrentPhase.TimeLeft >= 0; } public string GetTime() { TimeSpan timeSpan = TimeSpan.FromSeconds(MurderGame.Instance.CurrentPhase.TimeLeft); return timeSpan.ToString(@"mm\:ss"); } public string GetPhase() { return MurderGame.Instance.CurrentPhase.Title; } protected override int BuildHash() { return HashCode.Combine(MurderGame.Instance.CurrentPhase.TimeLeft.GetHashCode(), MurderGame.Instance.CurrentPhase.Title.GetHashCode()); } }