Struct Wire
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
[Nominal] This structure defines a wire that connects two nodes in a power circuit.
public struct Wire
Constructors
Wire()
The default constructor for a wire
public Wire()
Wire(Guid, Guid, TerminalType, TerminalType)
Constructs a new wire with the given nodes and terminals
public Wire(Guid nodeFrom, Guid nodeTo, TerminalType terminalFrom = TerminalType.Positive, TerminalType terminalTo = TerminalType.Negative)
Parameters
nodeFrom
GuidThe from node for the wire
nodeTo
GuidThe to node for the wire
terminalFrom
TerminalTypeThe terminal type for the from node
terminalTo
TerminalTypeThe terminal type for the to node
Fields
NodeFrom
The pointer to the from node for the wire.
public Guid NodeFrom
Field Value
NodeTo
The pointer to the to node for the wire.
public Guid NodeTo
Field Value
TerminalFrom
The terminal type for the from node.
public TerminalType TerminalFrom
Field Value
TerminalTo
The terminal type for the to node.
public TerminalType TerminalTo
Field Value
Methods
Equals(object)
Returns whether the wire is equal to another wire
public override bool Equals(object obj)
Parameters
obj
objectThe object to check
Returns
- bool
A success flag
FromJSON(JObject)
Converts a JSON object to a wire
public static Wire FromJSON(JObject json)
Parameters
json
JObjectThe JSON object storing the data
Returns
- Wire
The JSON object based on a wire
GetHashCode()
Returns the hash code for the wire
public override int GetHashCode()
Returns
ToJSON(Wire)
Converts a wire to a JSON object
public static JObject ToJSON(Wire wire)
Parameters
wire
WireThe wire to convert
Returns
- JObject
The JSON object based on a wire