From bee2db13544c6aec8ce38c1e67a3ea76fd196542 Mon Sep 17 00:00:00 2001 From: Stedd Date: Sat, 5 Oct 2024 19:24:11 +0200 Subject: [PATCH] Added simple power loss mechanic Also added two UI texts to see power consumption and generation --- Interfaces/IPowerSystem.cs | 43 +++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/Interfaces/IPowerSystem.cs b/Interfaces/IPowerSystem.cs index 7cf2232..3da9c64 100644 --- a/Interfaces/IPowerSystem.cs +++ b/Interfaces/IPowerSystem.cs @@ -2,18 +2,59 @@ namespace GameDev.CoreSystems { public interface IPowerSystem { + /// + /// This entity generates power + /// public bool IsGenerator { get; } + /// + /// This entity consumes power + /// public bool IsConsumer { get; } - public void SetMaxPower(int newValue); + /// + /// True if consumer demand exceed generator capacity + /// + public bool PowerLost { get; set; } + /// + /// Initialize the power configuration of the entity with the + /// + /// Power config for the entity public void Initialize(SoPowerConfig config); + /// + /// Max power for the entity + /// Generator capacity or max consumption depending on + /// the set type or + /// + /// + public void SetMaxPower(int newMaxPowerValue); + + /// + /// Current power for the entity + /// + /// current power generated/consumed power for this entity [W] + public void SetCurrentPower(int newCurrentPowerValue); + + /// + /// Get Max power for the entity + /// Generator capacity or max consumption depending on + /// the set type or + /// + /// The max power that can be generated/consumed by this entity [W] public int GetMaxPower(); + /// + /// Get current power for the entity. + /// + /// The power generated/consumed by this entity right now [W] public int GetCurrentPower(); + /// + /// Get the power factor for the entity + /// + /// The ratio between current power and max power [factor] public float GetPowerFactor(); } } \ No newline at end of file