Popcorning Guinea Pig
Search Results for

    Show / Hide Table of Contents

    Class GameTile

    Represents a single tile in a grid-based game system. Flexible design supports board games, 2D adventure games, puzzles, and more.

    Inheritance
    object
    GameTile
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: PopcorningGuineaPig.Engine.Gameplay
    Assembly: PopcorningGuineaPig.Engine.dll
    Syntax
    public class GameTile

    Constructors

    | Edit this page View Source

    GameTile(int, int, Vector3, Vector2)

    Creates a new GameTile with specified position and size.

    Declaration
    public GameTile(int gridX, int gridY, Vector3 worldPosition, Vector2 size)
    Parameters
    Type Name Description
    int gridX

    Grid X coordinate

    int gridY

    Grid Y coordinate

    Vector3 worldPosition

    3D world position

    Vector2 size

    Tile size (width, height)

    Properties

    | Edit this page View Source

    Bounds

    Declaration
    public BoundingBox Bounds { get; set; }
    Property Value
    Type Description
    BoundingBox
    | Edit this page View Source

    GridX

    Declaration
    public int GridX { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    GridY

    Declaration
    public int GridY { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    IsDropTarget

    Declaration
    public bool IsDropTarget { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsHighlighted

    Declaration
    public bool IsHighlighted { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsInteractable

    Declaration
    public bool IsInteractable { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsOccupied

    Declaration
    public bool IsOccupied { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsWalkable

    Declaration
    public bool IsWalkable { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Metadata

    Declaration
    public object? Metadata { get; set; }
    Property Value
    Type Description
    object
    | Edit this page View Source

    Occupant

    Declaration
    public object? Occupant { get; set; }
    Property Value
    Type Description
    object
    | Edit this page View Source

    Position

    Declaration
    public Vector3 Position { get; set; }
    Property Value
    Type Description
    Vector3
    | Edit this page View Source

    Size

    Declaration
    public Vector2 Size { get; set; }
    Property Value
    Type Description
    Vector2
    | Edit this page View Source

    Type

    Declaration
    public TileType Type { get; set; }
    Property Value
    Type Description
    TileType

    Methods

    | Edit this page View Source

    ClearOccupant()

    Removes any occupant from this tile.

    Declaration
    public object? ClearOccupant()
    Returns
    Type Description
    object

    The removed occupant, if any

    | Edit this page View Source

    ContainsPosition(Vector3)

    Checks if a world position is within this tile's bounds.

    Declaration
    public bool ContainsPosition(Vector3 worldPosition)
    Parameters
    Type Name Description
    Vector3 worldPosition

    3D world position to test

    Returns
    Type Description
    bool

    True if position is within tile bounds

    | Edit this page View Source

    GetGridDistance(GameTile)

    Gets the 2D distance from this tile to another tile (grid coordinates).

    Declaration
    public float GetGridDistance(GameTile other)
    Parameters
    Type Name Description
    GameTile other

    Other tile

    Returns
    Type Description
    float

    Grid distance

    | Edit this page View Source

    GetWorldDistance(GameTile)

    Gets the world distance from this tile's center to another tile's center.

    Declaration
    public float GetWorldDistance(GameTile other)
    Parameters
    Type Name Description
    GameTile other

    Other tile

    Returns
    Type Description
    float

    World distance

    | Edit this page View Source

    SetOccupant(object?)

    Places an occupant on this tile, removing any previous occupant.

    Declaration
    public object? SetOccupant(object? occupant)
    Parameters
    Type Name Description
    object occupant

    Object to place on this tile

    Returns
    Type Description
    object

    The previous occupant, if any

    | Edit this page View Source

    ToString()

    Returns a string that represents the current object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents the current object.

    Overrides
    object.ToString()
    • Edit this page
    • View Source
    In this article
    Back to top © 2024 Popcorning Guinea Pig Game Engine. A custom C# game engine for indie developers.