2020-08-14 06:52:17 +10:00
|
|
|
using System;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-07-12 01:32:10 -07:00
|
|
|
using Robust.Shared.GameStates;
|
2020-08-14 06:52:17 +10:00
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Radiation
|
2020-08-14 06:52:17 +10:00
|
|
|
{
|
2021-07-12 01:32:10 -07:00
|
|
|
[NetworkedComponent()]
|
2020-08-14 06:52:17 +10:00
|
|
|
public abstract class SharedRadiationPulseComponent : Component
|
|
|
|
|
{
|
|
|
|
|
public override string Name => "RadiationPulse";
|
|
|
|
|
|
2020-09-21 01:49:40 +02:00
|
|
|
public virtual float RadsPerSecond { get; set; }
|
|
|
|
|
|
2020-08-14 06:52:17 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// Radius of the pulse from its position
|
|
|
|
|
/// </summary>
|
2020-09-21 01:49:40 +02:00
|
|
|
public virtual float Range { get; set; }
|
2020-08-14 06:52:17 +10:00
|
|
|
|
2020-09-21 01:49:40 +02:00
|
|
|
public virtual bool Decay { get; set; }
|
|
|
|
|
public virtual bool Draw { get; set; }
|
|
|
|
|
|
2021-12-01 20:21:17 +00:00
|
|
|
public virtual TimeSpan StartTime { get; }
|
2020-09-21 01:49:40 +02:00
|
|
|
public virtual TimeSpan EndTime { get; }
|
2020-08-14 06:52:17 +10:00
|
|
|
}
|
2020-09-21 01:49:40 +02:00
|
|
|
|
2020-08-14 06:52:17 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// For syncing the pulse's lifespan between client and server for the overlay
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable, NetSerializable]
|
2020-09-21 01:49:40 +02:00
|
|
|
public class RadiationPulseState : ComponentState
|
2020-08-14 06:52:17 +10:00
|
|
|
{
|
2020-09-21 01:49:40 +02:00
|
|
|
public readonly float RadsPerSecond;
|
|
|
|
|
public readonly float Range;
|
|
|
|
|
public readonly bool Draw;
|
|
|
|
|
public readonly bool Decay;
|
2021-12-01 20:21:17 +00:00
|
|
|
public readonly TimeSpan StartTime;
|
2020-09-21 01:49:40 +02:00
|
|
|
public readonly TimeSpan EndTime;
|
2020-08-14 06:52:17 +10:00
|
|
|
|
2021-12-01 20:21:17 +00:00
|
|
|
public RadiationPulseState(float radsPerSecond, float range, bool draw, bool decay, TimeSpan startTime, TimeSpan endTime)
|
2020-08-14 06:52:17 +10:00
|
|
|
{
|
2020-09-21 01:49:40 +02:00
|
|
|
RadsPerSecond = radsPerSecond;
|
|
|
|
|
Range = range;
|
|
|
|
|
Draw = draw;
|
|
|
|
|
Decay = decay;
|
2021-12-01 20:21:17 +00:00
|
|
|
StartTime = startTime;
|
2020-08-14 06:52:17 +10:00
|
|
|
EndTime = endTime;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-09-21 01:49:40 +02:00
|
|
|
}
|