Struct RailProgress
Normalized progress along a rail path, expressed as a value between 0 and 1.
Immutable value object that supports equality comparison.
Assembly: Serenity.GameRail.Domain.dll
Syntax
public readonly struct RailProgress : IEquatable<RailProgress>
Constructors
RailProgress(float)
Creates a new RailProgress with the specified normalized value.
Declaration
public RailProgress(float value)
Parameters
| Type |
Name |
Description |
| float |
value |
The progress value, clamped to [0, 1].
|
Fields
Value
The normalized progress value (0 = start, 1 = end).
Declaration
public readonly float Value
Field Value
Properties
End
A RailProgress at the end of the path (1).
Declaration
public static RailProgress End { get; }
Property Value
IsAtEnd
Gets whether this progress is at the end.
Declaration
public bool IsAtEnd { get; }
Property Value
IsAtStart
Gets whether this progress is at the start.
Declaration
public bool IsAtStart { get; }
Property Value
Start
A RailProgress at the start of the path (0).
Declaration
public static RailProgress Start { get; }
Property Value
Methods
Advance(float)
Returns a new RailProgress advanced by the specified delta.
Declaration
public RailProgress Advance(float delta)
Parameters
| Type |
Name |
Description |
| float |
delta |
The amount to advance. Clamped to [0, 1].
|
Returns
| Type |
Description |
| RailProgress |
A new RailProgress with the updated value.
|
Equals(RailProgress)
Declaration
public bool Equals(RailProgress other)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
operator ==(RailProgress, RailProgress)
Declaration
public static bool operator ==(RailProgress left, RailProgress right)
Parameters
Returns
explicit operator RailProgress(float)
Declaration
public static explicit operator RailProgress(float value)
Parameters
| Type |
Name |
Description |
| float |
value |
|
Returns
implicit operator float(RailProgress)
Declaration
public static implicit operator float(RailProgress progress)
Parameters
Returns
operator !=(RailProgress, RailProgress)
Declaration
public static bool operator !=(RailProgress left, RailProgress right)
Parameters
Returns
Implements