Client LuaCsForBarotrauma
Signal.cs
2 {
3  partial struct Signal
4  {
5  public string value;
6  public int stepsTaken;
7  public Character sender;
8  public Item source;
9  public float power;
10  public float strength;
11  public readonly double CreationTime;
12 
13  public double TimeSinceCreated => Timing.TotalTimeUnpaused - CreationTime;
14 
15  public Signal(string value, int stepsTaken = 0, Character sender = null,
16  Item source = null, float power = 0.0f, float strength = 1.0f)
17  {
18  this.value = value;
19  this.stepsTaken = stepsTaken;
20  this.sender = sender;
21  this.source = source;
22  this.power = power;
23  this.strength = strength;
24  CreationTime = Timing.TotalTimeUnpaused;
25  }
26 
27  internal Signal WithStepsTaken(int stepsTaken)
28  {
29  Signal retVal = this;
30  retVal.stepsTaken = stepsTaken;
31  return retVal;
32  }
33 
34  public static bool operator ==(Signal a, Signal b) =>
35  a.value == b.value &&
36  a.stepsTaken == b.stepsTaken &&
37  a.sender == b.sender &&
38  a.source == b.source &&
39  MathUtils.NearlyEqual(a.power, b.power) &&
40  MathUtils.NearlyEqual(a.strength, b.strength);
41 
42  public static bool operator !=(Signal a, Signal b) => !(a == b);
43  }
44 }
static bool operator==(Signal a, Signal b)
readonly double CreationTime
Definition: Signal.cs:11
Signal(string value, int stepsTaken=0, Character sender=null, Item source=null, float power=0.0f, float strength=1.0f)
Definition: Signal.cs:15
static bool operator!=(Signal a, Signal b)