Struct ValidationCompletedEvent
- Namespace
- MoonBark.GridPlacement.Core.Events
- Assembly
- MoonBark.GridPlacement.Core.dll
Event raised when validation has been completed for an entity.
public readonly struct ValidationCompletedEvent : IEquatable<ValidationCompletedEvent>
- Implements
- Inherited Members
Constructors
ValidationCompletedEvent(int, bool, string?, CoreVector2I, int, bool)
public ValidationCompletedEvent(int entityId, bool isValid, string? reasonCode, CoreVector2I position, int placeableHash, bool isFinalValidation = false)
Parameters
entityIdintisValidboolreasonCodestringpositionCoreVector2IplaceableHashintisFinalValidationbool
Properties
EntityId
The entity ID that was validated.
public int EntityId { get; init; }
Property Value
IsFinalValidation
Whether this was a final validation triggered by confirm action. Used by PlacementInputBridge to determine if placement should proceed.
public bool IsFinalValidation { get; init; }
Property Value
IsValid
Whether the validation passed.
public bool IsValid { get; init; }
Property Value
PlaceableHash
The hash of the placeable that was validated.
public int PlaceableHash { get; init; }
Property Value
Position
The grid position that was validated.
public CoreVector2I Position { get; init; }
Property Value
- CoreVector2I
ReasonCode
The validation reason code (null if valid).
public string? ReasonCode { get; init; }
Property Value
Methods
Equals(ValidationCompletedEvent)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ValidationCompletedEvent other)
Parameters
otherValidationCompletedEventAn 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 ==(ValidationCompletedEvent, ValidationCompletedEvent)
public static bool operator ==(ValidationCompletedEvent left, ValidationCompletedEvent right)
Parameters
leftValidationCompletedEventrightValidationCompletedEvent
Returns
operator !=(ValidationCompletedEvent, ValidationCompletedEvent)
public static bool operator !=(ValidationCompletedEvent left, ValidationCompletedEvent right)
Parameters
leftValidationCompletedEventrightValidationCompletedEvent