RedLightGreenLightUI.razor
@using Sandbox;
@using Sandbox.UI;
@inherits PanelComponent
@namespace Sandbox

<root>
	<div class="title">@StateText</div>
</root>

@code
{

	[Property] public RedLightGreenLight Game { get; set; }

	[Property] public RedLightPlayer Player { get; set; }

	string StateText
{
    get
    {
		// Player-specific states come first
        if ( Player?.State == RedLightPlayer.PlayerState.GameOver )
            return "GAME OVER";
        else return "";
    }
}

	protected override int BuildHash()
    => System.HashCode.Combine( Game?.State, Player?.State );
}