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
Properties
EntityId
The unique identifier of the entity.
public int EntityId { get; init; }
Property Value
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
IsValid
Whether this entity is in a valid state.
public bool IsValid { get; init; }
Property Value
PlaceableHash
The hash of the placeable type.
public int PlaceableHash { get; init; }
Property Value
Methods
Equals(EntitySnapshot)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(EntitySnapshot other)
Parameters
otherEntitySnapshotAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
leftEntitySnapshotrightEntitySnapshot
Returns
operator !=(EntitySnapshot, EntitySnapshot)
public static bool operator !=(EntitySnapshot left, EntitySnapshot right)
Parameters
leftEntitySnapshotrightEntitySnapshot