Ui/Punchboard/PbMeeple.razor

This file defines a UI component called PbMeeple. It renders a meeple using three divs and allows its color to be customized using a Tint parameter.

@namespace CitySim.Punchboard
@using Sandbox.UI
@inherits Panel

<root class="pb-meeple">
	<div class="pb-meeple-head" style="background-color: @Pb.Rgba( Tint )"></div>
	<div class="pb-meeple-arms" style="background-color: @Pb.Rgba( Tint )"></div>
	<div class="pb-meeple-base" style="background-color: @Pb.Rgba( Tint )"></div>
</root>

@code
{
	/// <summary>The player's colour.</summary>
	[Parameter] public Color Tint { get; set; } = new Color( 185f / 255, 79f / 255, 62f / 255 );

	protected override int BuildHash() => HashCode.Combine(GameText.LanguageCode, HashCode.Combine( Tint ));
}