Table of Contents

Struct ValidationRequestEvent

Namespace
MoonBark.GridPlacement.Core.Events
Assembly
MoonBark.GridPlacement.Core.dll

Event raised when a placement validation should be performed. Published when cursor position changes (preview) or when confirm is pressed (final).

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

Constructors

ValidationRequestEvent(int, CoreVector2I, int, bool)

public ValidationRequestEvent(int entityId, CoreVector2I position, int placeableHash, bool isFinalValidation = false)

Parameters

entityId int
position CoreVector2I
placeableHash int
isFinalValidation bool

Properties

EntityId

The entity ID to validate.

public int EntityId { get; init; }

Property Value

int

IsFinalValidation

Whether this is a final validation triggered by confirm action. Final validation runs before placement execution to catch race conditions.

public bool IsFinalValidation { get; init; }

Property Value

bool

PlaceableHash

The hash of the placeable to validate.

public int PlaceableHash { get; init; }

Property Value

int

Position

The grid position to validate.

public CoreVector2I Position { get; init; }

Property Value

CoreVector2I

Methods

Equals(ValidationRequestEvent)

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

public bool Equals(ValidationRequestEvent other)

Parameters

other ValidationRequestEvent

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 ==(ValidationRequestEvent, ValidationRequestEvent)

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

Parameters

left ValidationRequestEvent
right ValidationRequestEvent

Returns

bool

operator !=(ValidationRequestEvent, ValidationRequestEvent)

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

Parameters

left ValidationRequestEvent
right ValidationRequestEvent

Returns

bool