Table of Contents

Struct EntitySnapshot

Namespace
MoonBark.GridPlacement.Core.Types
Assembly
MoonBark.GridPlacement.Core.dll

Represents a snapshot of an entity's state at a point in time. Used for querying entity information without direct ECS references.

public readonly struct EntitySnapshot : IEquatable<EntitySnapshot>
Implements
Inherited Members

Constructors

EntitySnapshot(int, GridPosition, int, bool, bool)

Creates a new entity snapshot.

public EntitySnapshot(int entityId, GridPosition gridPosition, int placeableHash, bool isGhost, bool isValid)

Parameters

entityId int
gridPosition GridPosition
placeableHash int
isGhost bool
isValid bool

Properties

EntityId

The unique identifier of the entity.

public int EntityId { get; init; }

Property Value

int

GridPosition

The grid position of the entity.

public GridPosition GridPosition { get; init; }

Property Value

GridPosition

IsGhost

Whether this is a ghost/preview entity.

public bool IsGhost { get; init; }

Property Value

bool

IsValid

Whether this entity is in a valid state.

public bool IsValid { get; init; }

Property Value

bool

PlaceableHash

The hash of the placeable type.

public int PlaceableHash { get; init; }

Property Value

int

Methods

Equals(EntitySnapshot)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(EntitySnapshot other)

Parameters

other EntitySnapshot

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(EntitySnapshot, EntitySnapshot)

public static bool operator ==(EntitySnapshot left, EntitySnapshot right)

Parameters

left EntitySnapshot
right EntitySnapshot

Returns

bool

operator !=(EntitySnapshot, EntitySnapshot)

public static bool operator !=(EntitySnapshot left, EntitySnapshot right)

Parameters

left EntitySnapshot
right EntitySnapshot

Returns

bool