The CardInteractions.razor component renders interaction targets for a card in the game UI. It displays a heading and a list of chips, each representing an entity the card interacts with.
@namespace CitySim
@using CitySim.Cards
@using CitySim.Match
@using Sandbox.UI
@inherits Panel
<root class="card-interactions">
@if (Targets.Count > 0)
{
<InteractionChip City=@City Label=@(GameText.Get("ui.card_interactions.interacts_with")) Targets=@Targets Heading=@true />
<div class="interaction-list">@foreach (var target in Targets) { <InteractionChip City=@City Label=@(GameText.Plain(target.Label)) Targets=@(new[] { target }) /> }</div>
}
</root>
@code {
[Parameter] public CityGame City { get; set; }
[Parameter] public CardDef Card { get; set; }
IReadOnlyList<InteractionTarget> Targets => CardPresentation.Targets(Card);
protected override int BuildHash() => HashCode.Combine(GameText.LanguageCode, Card?.Id.GetHashCode() ?? 0);
}