Struct PortalWorldState
A portal's world-wide opening: for good, or until a moment.
public readonly struct PortalWorldState : IEquatable<PortalWorldState>
- Implements
- Inherited Members
Remarks
Merged rather than replaced (Merge(PortalWorldState, PortalWorldState)): permanent ORs and the deadline takes the
later moment, which is exactly what the world_portal_state upsert does, so the memory
copy and the row converge whichever write lands first.
Constructors
PortalWorldState(bool, long)
public PortalWorldState(bool permanent, long activeUntilUnixMs)
Parameters
Fields
ActiveUntilUnixMs
Unix milliseconds a timed opening ends at; 0 when never timed.
public readonly long ActiveUntilUnixMs
Field Value
Permanent
Open for good.
public readonly bool Permanent
Field Value
Methods
Covers(PortalWorldState)
Whether other says nothing this state does not already say.
public bool Covers(PortalWorldState other)
Parameters
otherPortalWorldState
Returns
Equals(PortalWorldState)
public bool Equals(PortalWorldState other)
Parameters
otherPortalWorldState
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
IsActive(long)
Whether the portal is open at nowUnixMs.
public bool IsActive(long nowUnixMs)
Parameters
nowUnixMslong
Returns
Merge(PortalWorldState, PortalWorldState)
The union of two openings: permanent if either is, open until the later deadline.
public static PortalWorldState Merge(PortalWorldState a, PortalWorldState b)
Parameters
Returns
RemainingSeconds(long)
Whole seconds the opening has left at nowUnixMs, rounded up;
NoExpiry when permanent, 0 when closed.
public int RemainingSeconds(long nowUnixMs)
Parameters
nowUnixMslong
Returns
ToString()
public override string ToString()