From 2a6bc4542ef97b4dfce63723ca2aace46609c9a2 Mon Sep 17 00:00:00 2001 From: 6d486f49 Date: Thu, 18 Jun 2026 00:26:29 -0400 Subject: [PATCH] Adding StatEfficiency --- Chrono/Model/CardData.cs | 9 +++++++++ Chrono/Web/Pages/Agents.razor | 12 ++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Chrono/Model/CardData.cs b/Chrono/Model/CardData.cs index 4587e3d..6b66680 100644 --- a/Chrono/Model/CardData.cs +++ b/Chrono/Model/CardData.cs @@ -7,6 +7,15 @@ public class CardData public int? Cost { get; init; } public int? Attack { get; init; } public int? Health { get; init; } + + public float StatEfficiency() + { + if(Cost == 0) return 0; + if (Attack != null && Cost != null && Health != null) return MathF.Round((float)((Health + Attack) / (float)Cost),2); + return 0; + } + + public string? Description { get; init; } public string? Faction { get; init; } public string? Set { get; init; } diff --git a/Chrono/Web/Pages/Agents.razor b/Chrono/Web/Pages/Agents.razor index 5771d34..c87161e 100644 --- a/Chrono/Web/Pages/Agents.razor +++ b/Chrono/Web/Pages/Agents.razor @@ -3,18 +3,13 @@ Agents
-
-

Agents

-

@agents.Count agents in the database

-
- @@ -35,6 +30,11 @@ + + +