62 lines
2.1 KiB
C#
62 lines
2.1 KiB
C#
using ScriptableObjectArchitecture;
|
|
|
|
namespace GameDev.CoreSystems
|
|
{
|
|
public interface IPowerSystem
|
|
{
|
|
/// <summary>
|
|
/// This entity generates power
|
|
/// </summary>
|
|
public bool IsGenerator { get; }
|
|
|
|
/// <summary>
|
|
/// This entity consumes power
|
|
/// </summary>
|
|
public bool IsConsumer { get; }
|
|
|
|
/// <summary>
|
|
/// True if consumer demand exceed generator capacity
|
|
/// </summary>
|
|
public BoolReference PowerLost { get; set; }
|
|
|
|
/// <summary>
|
|
/// Initialize the power configuration of the entity with the <see cref="SoPowerConfig"/>
|
|
/// </summary>
|
|
/// <param name="config">Power config for the entity</param>
|
|
public void Initialize(SoPowerConfig config);
|
|
|
|
/// <summary>
|
|
/// Max power for the entity
|
|
/// Generator capacity or max consumption depending on
|
|
/// the set type <see cref="IsGenerator"/> or <see cref="IsConsumer"/>
|
|
/// </summary>
|
|
/// <param name="newMaxPowerValue"></param>
|
|
public void SetMaxPower(int newMaxPowerValue);
|
|
|
|
/// <summary>
|
|
/// Current power for the entity
|
|
/// </summary>
|
|
/// <param name="newCurrentPowerValue">current power generated/consumed power for this entity [W]</param>
|
|
public void SetCurrentPower(int newCurrentPowerValue);
|
|
|
|
/// <summary>
|
|
/// Get Max power for the entity
|
|
/// Generator capacity or max consumption depending on
|
|
/// the set type <see cref="IsGenerator"/> or <see cref="IsConsumer"/>
|
|
/// </summary>
|
|
/// <returns>The max power that can be generated/consumed by this entity [W]</returns>
|
|
public int GetMaxPower();
|
|
|
|
/// <summary>
|
|
/// Get current power for the entity.
|
|
/// </summary>
|
|
/// <returns>The power generated/consumed by this entity right now [W]</returns>
|
|
public int GetCurrentPower();
|
|
|
|
/// <summary>
|
|
/// Get the power factor for the entity
|
|
/// </summary>
|
|
/// <returns>The ratio between current power and max power [factor]</returns>
|
|
public float GetPowerFactor();
|
|
}
|
|
} |