Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ScAction.cs
1using System;
4
6{
10 [StructLayout(LayoutKind.Sequential)]
11 public struct ScAction : IEquatable<ScAction>
12 {
13 private ScActionType _Type;
14 private uint _Delay;
15
20 {
21 get => this._Type;
22 set => this._Type = value;
23 }
24
28 public TimeSpan Delay
29 {
30 get => TimeSpan.FromMilliseconds(this._Delay);
31 set => this._Delay = (uint)Math.Round(value.TotalMilliseconds);
32 }
33
39 public bool Equals(ScAction Other)
40 {
41 return this._Type == Other._Type &&
42 this._Delay == Other._Delay;
43 }
44
46 public override bool Equals(object obj)
47 {
48 if (obj is null)
49 return false;
50
51 return obj is ScAction Typed && this.Equals(Typed);
52 }
53
55 public override int GetHashCode()
56 {
57 int h1 = this.Delay.GetHashCode();
58 int h2 = this.Type.GetHashCode();
59
60 return ((h1 << 5) + h1) ^ h2;
61 }
62 }
63}
ScActionType
Service controller action type
Definition: ScActionType.cs:7
bool Equals(ScAction Other)
Compares to instances
Definition: ScAction.cs:39