Remote Explorer Game
Search Results for

    Show / Hide Table of Contents

    Struct Tile

    Represents a two-character tile on the map. Each tile consists of a left and right character.

    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: ExplorerGame.Core
    Assembly: explorer-game.dll
    Syntax
    public struct Tile

    Constructors

    | Edit this page View Source

    Tile(char, char)

    Initializes a new Tile with the specified left and right characters.

    Declaration
    public Tile(char left, char right)
    Parameters
    Type Name Description
    char left

    The left character.

    char right

    The right character.

    Exceptions
    Type Condition
    ArgumentException

    Thrown when either character is not allowed.

    | Edit this page View Source

    Tile(string)

    Creates a tile from a 2-character string. Throws if string length is not exactly 2.

    Declaration
    public Tile(string str)
    Parameters
    Type Name Description
    string str

    Properties

    | Edit this page View Source

    Left

    Gets or sets the left character of the two-character tile.

    Declaration
    public char Left { get; set; }
    Property Value
    Type Description
    char
    Exceptions
    Type Condition
    ArgumentException

    Thrown when the value is not an allowed character.

    | Edit this page View Source

    Right

    Gets or sets the right character of the two-character tile.

    Declaration
    public char Right { get; set; }
    Property Value
    Type Description
    char
    Exceptions
    Type Condition
    ArgumentException

    Thrown when the value is not an allowed character.

    Methods

    | Edit this page View Source

    Deserialize(JObject?)

    Deserializes a Tile from a Newtonsoft.Json.Linq.JObject.

    Declaration
    public static Tile? Deserialize(JObject? jobj)
    Parameters
    Type Name Description
    JObject jobj

    The JSON object to read from, or null.

    Returns
    Type Description
    Tile?

    The deserialized tile, or null if jobj is null.

    Exceptions
    Type Condition
    ArgumentException

    Thrown when the JSON object does not contain the required str value.

    | Edit this page View Source

    Equals(object?)

    Determines whether this instance and a specified object, which must also be a Tile, have the same left and right characters.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current instance.

    Returns
    Type Description
    bool

    true if the tiles are equal; otherwise, false.

    Overrides
    ValueType.Equals(object)
    | Edit this page View Source

    GetHashCode()

    Returns a hash code for this tile.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A 32-bit signed integer hash code.

    Overrides
    ValueType.GetHashCode()
    | Edit this page View Source

    Serialize(Tile?)

    Serializes a nullable Tile to a Newtonsoft.Json.Linq.JObject.

    Declaration
    public static JObject? Serialize(Tile? tile)
    Parameters
    Type Name Description
    Tile? tile

    The tile to serialize, or null.

    Returns
    Type Description
    JObject

    A Newtonsoft.Json.Linq.JObject with the tile data, or null if tile is null.

    | Edit this page View Source

    ToString()

    Returns the two-character string that represents this tile.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A two-character string.

    Overrides
    ValueType.ToString()

    Operators

    | Edit this page View Source

    operator ==(Tile, Tile)

    Determines whether two tiles are the same.

    Declaration
    public static bool operator ==(Tile a, Tile b)
    Parameters
    Type Name Description
    Tile a

    The first tile.

    Tile b

    The second tile.

    Returns
    Type Description
    bool

    true if equal; otherwise, false.

    | Edit this page View Source

    implicit operator Tile(string)

    Implicit conversion from string to tile. Allows easy construction from string literals.

    Declaration
    public static implicit operator Tile(string str)
    Parameters
    Type Name Description
    string str
    Returns
    Type Description
    Tile
    | Edit this page View Source

    operator !=(Tile, Tile)

    Determines whether two tiles differ.

    Declaration
    public static bool operator !=(Tile a, Tile b)
    Parameters
    Type Name Description
    Tile a

    The first tile.

    Tile b

    The second tile.

    Returns
    Type Description
    bool

    true if not equal; otherwise, false.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX