Table of Contents

Struct TargetPositionComponent

Namespace
MoonBark.GridPlacement.Core.Services.Targeting
Assembly
MoonBark.GridPlacement.Core.dll

Component storing the current target grid position and revision. Pure domain struct - no ECS dependency.

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

Constructors

TargetPositionComponent(CoreVector2I)

public TargetPositionComponent(CoreVector2I position)

Parameters

position CoreVector2I

Fields

Zero

public static readonly TargetPositionComponent Zero

Field Value

TargetPositionComponent

Properties

Position

public CoreVector2I Position { get; init; }

Property Value

CoreVector2I

Revision

public long Revision { get; init; }

Property Value

long

Methods

Equals(TargetPositionComponent)

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

public bool Equals(TargetPositionComponent other)

Parameters

other TargetPositionComponent

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

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

Parameters

left TargetPositionComponent
right TargetPositionComponent

Returns

bool

operator !=(TargetPositionComponent, TargetPositionComponent)

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

Parameters

left TargetPositionComponent
right TargetPositionComponent

Returns

bool