Class VisualSessionIdentifier
Visual identifier for a session (two-character symbol + console color). Performs validation against reserved patterns and map tile collisions.
Inherited Members
Namespace: ExplorerGame.Core
Assembly: explorer-game.dll
Syntax
public class VisualSessionIdentifier
Constructors
| Edit this page View SourceVisualSessionIdentifier(string, ConsoleColor, Tile?[,]?)
Creates a new visual session identifier and validates string and color.
Declaration
public VisualSessionIdentifier(string identifierStr, ConsoleColor color = ConsoleColor.White, Tile?[,]? map = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | identifierStr | Two-character identifier string. |
| ConsoleColor | color | Console color for the identifier. |
| Tile?[,] | map | Optional map for tile-collision checks. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the identifier string is too long, the color is invalid, or the combination is reserved. |
Fields
| Edit this page View SourceERROR_IDENTIFIER
Special identifier used to indicate an error state.
Declaration
public static readonly VisualSessionIdentifier ERROR_IDENTIFIER
Field Value
| Type | Description |
|---|---|
| VisualSessionIdentifier |
INVALID_COLORS
Colors that are not allowed for identifiers (e.g., current console background).
Declaration
public static readonly HashSet<ConsoleColor> INVALID_COLORS
Field Value
| Type | Description |
|---|---|
| HashSet<ConsoleColor> |
SESSION_COUNTER_COLOR
Color used when rendering a numeric counter for multiple agents on the same tile.
Declaration
public const ConsoleColor SESSION_COUNTER_COLOR = Yellow
Field Value
| Type | Description |
|---|---|
| ConsoleColor |
Properties
| Edit this page View SourceColor
Console color associated with this identifier.
Declaration
public ConsoleColor Color { get; set; }
Property Value
| Type | Description |
|---|---|
| ConsoleColor |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the color is not allowed or would make the identifier reserved. |
IdentifierStr
Two-character identifier string used for rendering.
Declaration
public string IdentifierStr { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the string is longer than 2 characters or would make the identifier reserved. |
Methods
| Edit this page View SourceIsReserved(VisualSessionIdentifier, Tile?[,]?)
Returns true if the given identifier instance is reserved.
Declaration
public static bool IsReserved(VisualSessionIdentifier identifier, Tile?[,]? map = null)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualSessionIdentifier | identifier | |
| Tile?[,] | map |
Returns
| Type | Description |
|---|---|
| bool |
IsReserved(string, ConsoleColor, Tile?[,]?)
Returns true if the provided string/color combination is reserved. Checks reserved patterns and (optionally) collisions with map tile strings.
Declaration
public static bool IsReserved(string identifierStr, ConsoleColor color, Tile?[,]? map = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | identifierStr | Two-character identifier. |
| ConsoleColor | color | Requested console color. |
| Tile?[,] | map | Optional map to detect collisions with tile strings. |
Returns
| Type | Description |
|---|---|
| bool |