From 919754d284c7bf3fc88077e1b639615f42674e49 Mon Sep 17 00:00:00 2001 From: 6d486f49 Date: Thu, 18 Jun 2026 00:30:06 -0400 Subject: [PATCH] ...model fix --- Chrono/Model/CardData.cs | 9 +++------ Chrono/Web/Pages/Agents.razor | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Chrono/Model/CardData.cs b/Chrono/Model/CardData.cs index 6b66680..7963ccb 100644 --- a/Chrono/Model/CardData.cs +++ b/Chrono/Model/CardData.cs @@ -8,12 +8,9 @@ public class CardData 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 float StatEfficiency => Cost is > 0 && Attack is not null && Health is not null + ? MathF.Round((Health.Value + Attack.Value) / (float)Cost.Value, 2) + : 0; public string? Description { get; init; } diff --git a/Chrono/Web/Pages/Agents.razor b/Chrono/Web/Pages/Agents.razor index c87161e..f10f2c9 100644 --- a/Chrono/Web/Pages/Agents.razor +++ b/Chrono/Web/Pages/Agents.razor @@ -32,7 +32,7 @@