Skip to content

Commit b4ae029

Browse files
authored
Add total cost to TaskForce info hint text
1 parent a1736f2 commit b4ae029

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/TSMapEditor/Models/TaskForce.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public string GetHintText()
131131
StringBuilder sb = new StringBuilder();
132132
sb.Append("Contains:");
133133

134+
int totalCost = 0;
134135
foreach (var entry in TechnoTypes)
135136
{
136137
if (entry == null)
@@ -141,8 +142,14 @@ public string GetHintText()
141142
sb.Append(entry.Count);
142143
sb.Append("x ");
143144
sb.Append(entry.TechnoType.GetEditorDisplayName());
145+
146+
totalCost += entry.TechnoType.Cost * entry.Count;
144147
}
145148

149+
sb.Append(Environment.NewLine);
150+
sb.Append(Environment.NewLine);
151+
sb.Append("Total Cost: $" + totalCost);
152+
146153
return sb.ToString();
147154
}
148155

0 commit comments

Comments
 (0)