Class SessionIdentifier
Represents a game session identifier, combining a server-side session ID (SID) with an optional visual identifier (VSID) for rendering in the console.
Inherited Members
Namespace: ExplorerGame.Core
Assembly: explorer-game.dll
Syntax
public class SessionIdentifier
Constructors
| Edit this page View SourceSessionIdentifier(VisualSessionIdentifier?, string?)
Creates a session identifier from existing visual and server IDs.
Declaration
public SessionIdentifier(VisualSessionIdentifier? vsid = null, string? sid = null)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualSessionIdentifier | vsid | |
| string | sid |
SessionIdentifier(string, ConsoleColor, Tile?[,]?)
Creates a session identifier backed by a new VisualSessionIdentifier.
Declaration
public SessionIdentifier(string identifier, ConsoleColor color = ConsoleColor.White, Tile?[,]? map = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | identifier | |
| ConsoleColor | color | |
| Tile?[,] | map |
Properties
| Edit this page View SourceColor
Console color associated with the visual identifier. Proxies to Color.
Declaration
public ConsoleColor? Color { get; set; }
Property Value
| Type | Description |
|---|---|
| ConsoleColor? |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when attempting to set to null. |
| ArgumentException | Thrown when no VSID is associated. |
ConnectionReady
True when SID is present.
Declaration
public bool ConnectionReady { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HasVSID
True when VSID is present.
Declaration
[MemberNotNullWhen(true, "VSID")]
[MemberNotNullWhen(true, "IdentifierStr")]
[MemberNotNullWhen(true, "Color")]
public bool HasVSID { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IdentifierStr
Two-character identifier string for rendering. Proxies to IdentifierStr.
Declaration
public string? IdentifierStr { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when attempting to set to null. |
| ArgumentException | Thrown when no VSID is associated. |
SID
Server-side session ID assigned by the backend. When set, the connection is considered ready.
Declaration
public string? SID { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
VSID
Optional visual identifier used for rendering (symbol and color).
Declaration
public VisualSessionIdentifier? VSID { get; set; }
Property Value
| Type | Description |
|---|---|
| VisualSessionIdentifier |
Operators
| Edit this page View Sourceimplicit operator SessionIdentifier(VisualSessionIdentifier)
Implicitly wraps a VisualSessionIdentifier into a SessionIdentifier.
Declaration
public static implicit operator SessionIdentifier(VisualSessionIdentifier vsid)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualSessionIdentifier | vsid |
Returns
| Type | Description |
|---|---|
| SessionIdentifier |