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
Properties
EntityId
The entity ID to validate.
public int EntityId { get; init; }
Property Value
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
PlaceableHash
The hash of the placeable to validate.
public int PlaceableHash { get; init; }
Property Value
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
otherValidationRequestEventAn 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 ==(ValidationRequestEvent, ValidationRequestEvent)
public static bool operator ==(ValidationRequestEvent left, ValidationRequestEvent right)
Parameters
leftValidationRequestEventrightValidationRequestEvent
Returns
operator !=(ValidationRequestEvent, ValidationRequestEvent)
public static bool operator !=(ValidationRequestEvent left, ValidationRequestEvent right)
Parameters
leftValidationRequestEventrightValidationRequestEvent