bisschen gui bisschen moving timeline

This commit is contained in:
2026-07-29 22:54:19 +02:00
parent 9824b30435
commit 0bb8ce47c0
13 changed files with 240 additions and 119 deletions

View File

@@ -1,19 +1,57 @@
using Godot;
using yourareanaiceo;
[GlobalClass]
public partial class Company : Resource
{
[Export]
public float Hype { get; set; }
private float _averageSalary = 100;
private float _hype;
private float _money = 1_000;
private float _workers = 1;
[Export]
public float Money { get; set; } = 10_000;
public float Hype
{
get => _hype;
set
{
_hype = value;
EmitCompanyStatusChanged();
}
}
[Export]
public float Workers { get; set; } = 1;
public float Money
{
get => _money;
set
{
_money = value;
EmitCompanyStatusChanged();
}
}
[Export]
public float AverageSalary { get; set; } = 100;
public float Workers
{
get => _workers;
set
{
_workers = value;
EmitCompanyStatusChanged();
}
}
[Export]
public float AverageSalary
{
get => _averageSalary;
set
{
_averageSalary = value;
EmitCompanyStatusChanged();
}
}
/// <summary>
/// Cost per Quarter
@@ -24,4 +62,11 @@ public partial class Company : Resource
/// Runway in Quarters
/// </summary>
public int Runway => Mathf.FloorToInt(Money / Cost);
private void EmitCompanyStatusChanged()
{
EventBus.CompanyChanged.Invoke(new CompanyStats(Hype, Money, Workers, Runway));
}
public record CompanyStats(float Hype, float Money, float Workers, int Runway);
}