Table of Contents

Struct ValidationComponent

Namespace
MoonBark.GridPlacement.Core.Interfaces
Assembly
MoonBark.GridPlacement.Core.dll

Pure domain validation component for placement validation results. No ECS dependencies.

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

Constructors

ValidationComponent(bool, string, long, CoreVector2I)

public ValidationComponent(bool isValid, string reasonCode = "ok", long timestamp = 0, CoreVector2I position = default)

Parameters

isValid bool
reasonCode string
timestamp long
position CoreVector2I

Properties

IsValid

public bool IsValid { get; init; }

Property Value

bool

LastValidatedPosition

public CoreVector2I LastValidatedPosition { get; init; }

Property Value

CoreVector2I

LastValidatedTimestamp

public long LastValidatedTimestamp { get; init; }

Property Value

long

ReasonCode

public string ReasonCode { get; init; }

Property Value

string

Methods

Equals(ValidationComponent)

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

public bool Equals(ValidationComponent other)

Parameters

other ValidationComponent

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.

Invalid(string, long, CoreVector2I)

public static ValidationComponent Invalid(string reason, long timestamp = 0, CoreVector2I position = default)

Parameters

reason string
timestamp long
position CoreVector2I

Returns

ValidationComponent

Valid(long, CoreVector2I)

public static ValidationComponent Valid(long timestamp = 0, CoreVector2I position = default)

Parameters

timestamp long
position CoreVector2I

Returns

ValidationComponent

Operators

operator ==(ValidationComponent, ValidationComponent)

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

Parameters

left ValidationComponent
right ValidationComponent

Returns

bool

operator !=(ValidationComponent, ValidationComponent)

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

Parameters

left ValidationComponent
right ValidationComponent

Returns

bool