Show More
Commit Description:
Change delta to be per-year
Commit Description:
Change delta to be per-year
File last commit:
Show/Diff file:
Action:
isometric-park-fna/Renderers/ImGuiWindowRenderer.cs
65 lines | 2.1 KiB | text/x-csharp | CSharpLexer
Add contracts window.
r194 using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using isometricparkfna.UI;
using isometricparkfna.Engines;
using isometricparkfna.Components;
using isometricparkfna.Messages;
using ImGuiNET;
using Encompass;
using SpriteFontPlus;
namespace isometricparkfna.Renderers
{
public class ImGuiWindowRenderer : GeneralRenderer
{
private ImFontPtr font;
private ImGuiWindowBridgeEngine BridgeEngine;
public ImGuiWindowRenderer(ImFontPtr font, ImGuiWindowBridgeEngine engine)
{
this.font = font;
this.BridgeEngine = engine;
}
public override void Render()
{
foreach (ref readonly var entity in ReadEntities<WindowTypeComponent>())
{
var window_type = GetComponent<WindowTypeComponent>(entity).type;
var visible = GetComponent<VisibilityComponent>(entity).visible;
if (visible)
{
switch (window_type)
{
case Window.Contracts:
var contracts = ReadEntities<AreaComponent>();
Add Contracts to budget.
r201 var contract_data = new List<(Entity, string, ContractStatus, decimal)>();
Add contracts window.
r194
// var names = contracts.Select(entity => GetComponent<NameComponent>(entity).DisplayName)
foreach(var e in contracts)
{
Add status to Contracts window.
r195 var name = GetComponent<NameComponent>(e).DisplayName;
var status = GetComponent<ContractStatusComponent>(e).status;
Add Contracts to budget.
r201 var amount = GetComponent<BudgetLineComponent>(e).amount;
contract_data.Add((e, name, status, amount));
Add contracts window.
r194
}
Add status to Contracts window.
r195 ContractsWindow.Render(this.font, this.BridgeEngine, contract_data);
Add contracts window.
r194 break;
default:
break;
}
}
}
}
}
}