2021-02-01 10:19:43 -06:00
|
|
|
using System;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Power.Components;
|
|
|
|
|
using Content.Server.Solar.EntitySystems;
|
2020-05-21 20:08:03 +01:00
|
|
|
using Robust.Server.GameObjects;
|
2021-11-26 09:17:21 +00:00
|
|
|
using Robust.Shared.Analyzers;
|
2020-05-21 20:08:03 +01:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-03-05 01:08:38 +01:00
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.Timing;
|
2020-05-21 20:08:03 +01:00
|
|
|
using Robust.Shared.ViewVariables;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Solar.Components
|
2020-05-21 20:08:03 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is a solar panel.
|
|
|
|
|
/// It generates power from the sun based on coverage.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent]
|
2021-11-26 09:17:21 +00:00
|
|
|
[Friend(typeof(PowerSolarSystem))]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class SolarPanelComponent : Component
|
2020-05-21 20:08:03 +01:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Maximum supply output by this panel (coverage = 1)
|
|
|
|
|
/// </summary>
|
2021-11-26 09:17:21 +00:00
|
|
|
[DataField("maxSupply")]
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public int MaxSupply = 1500;
|
2020-05-21 20:08:03 +01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Current coverage of this panel (from 0 to 1).
|
|
|
|
|
/// This is updated by <see cref='PowerSolarSystem'/>.
|
2021-11-26 09:17:21 +00:00
|
|
|
/// DO NOT WRITE WITHOUT CALLING UpdateSupply()!
|
2020-06-02 12:32:18 +01:00
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables]
|
2021-11-26 09:17:21 +00:00
|
|
|
public float Coverage { get; set; } = 0;
|
2020-05-21 20:08:03 +01:00
|
|
|
}
|
|
|
|
|
}
|