Table of Contents

Class RoundingModeLongExtensions

Namespace
ElectricDrill.AstraRpgFramework.Utils
Assembly
com.electricdrill.astra-rpg-framework.Runtime.dll

long-value helpers for RoundingMode, shared by any package that needs to round a fractional gameplay amount (damage, healing, modifier deltas, etc.) to a long. Round uses midpoint-away-from-zero semantics to match the RoundingMode contract.

public static class RoundingModeLongExtensions
Inheritance
object
RoundingModeLongExtensions

Methods

ApplyToLong(RoundingMode, double)

Applies mode to value and returns a long.

public static long ApplyToLong(this RoundingMode mode, double value)

Parameters

mode RoundingMode

Rounding mode to apply.

value double

Value to round.

Returns

long

The rounded long value.

ApplyToNonNegativeLong(RoundingMode, double)

Clamps value to zero before applying mode.

public static long ApplyToNonNegativeLong(this RoundingMode mode, double value)

Parameters

mode RoundingMode

Rounding mode to apply.

value double

Value to clamp and round.

Returns

long

The rounded non-negative long value.