logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct RailProgress

    Normalized progress along a rail path, expressed as a value between 0 and 1. Immutable value object that supports equality comparison.

    Implements
    IEquatable<RailProgress>
    Inherited Members
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.GameRail.Domain.ValueObjects
    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
    Type Description
    float

    Properties

    End

    A RailProgress at the end of the path (1).

    Declaration
    public static RailProgress End { get; }
    Property Value
    Type Description
    RailProgress

    IsAtEnd

    Gets whether this progress is at the end.

    Declaration
    public bool IsAtEnd { get; }
    Property Value
    Type Description
    bool

    IsAtStart

    Gets whether this progress is at the start.

    Declaration
    public bool IsAtStart { get; }
    Property Value
    Type Description
    bool

    Start

    A RailProgress at the start of the path (0).

    Declaration
    public static RailProgress Start { get; }
    Property Value
    Type Description
    RailProgress

    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
    Type Name Description
    RailProgress other
    Returns
    Type Description
    bool

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    ValueType.Equals(object)

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    Operators

    operator ==(RailProgress, RailProgress)

    Declaration
    public static bool operator ==(RailProgress left, RailProgress right)
    Parameters
    Type Name Description
    RailProgress left
    RailProgress right
    Returns
    Type Description
    bool

    explicit operator RailProgress(float)

    Declaration
    public static explicit operator RailProgress(float value)
    Parameters
    Type Name Description
    float value
    Returns
    Type Description
    RailProgress

    implicit operator float(RailProgress)

    Declaration
    public static implicit operator float(RailProgress progress)
    Parameters
    Type Name Description
    RailProgress progress
    Returns
    Type Description
    float

    operator !=(RailProgress, RailProgress)

    Declaration
    public static bool operator !=(RailProgress left, RailProgress right)
    Parameters
    Type Name Description
    RailProgress left
    RailProgress right
    Returns
    Type Description
    bool

    Implements

    IEquatable<T>
    In this article
    © 2026 Serenity. All Rights Reserved