More FloatMath -> MathHelper from merge.

This commit is contained in:
Pieter-Jan Briers
2020-08-20 20:34:32 +02:00
parent bf60a4e9fc
commit 8a2530e7a0
3 changed files with 3 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ namespace Content.Server.AI.Utility.Considerations
// Previously we used a makeupvalue method although the geometric mean is less punishing for more considerations
var considerationsCount = context.GetState<ConsiderationState>().GetValue();
var adjustedScore = MathF.Pow(score, 1 / (float) considerationsCount);
return FloatMath.Clamp(adjustedScore, 0.0f, 1.0f);
return MathHelper.Clamp(adjustedScore, 0.0f, 1.0f);
}
[Pure]

View File

@@ -165,7 +165,7 @@ namespace Content.Server.GameObjects.EntitySystems.Atmos
if (moles < gas.GasMolesVisible) continue;
var data = new GasData(i, (byte) (FloatMath.Clamp01(moles / gas.GasMolesVisibleMax) * 255));
var data = new GasData(i, (byte) (MathHelper.Clamp01(moles / gas.GasMolesVisibleMax) * 255));
tileData.Add(data);
}

View File

@@ -68,7 +68,7 @@ namespace Content.Server.GameTicking.GamePresets
player.AttachedEntity?.EnsureComponent<SuspicionRoleComponent>();
}
var numTraitors = FloatMath.Clamp(readyPlayers.Count / PlayersPerTraitor,
var numTraitors = MathHelper.Clamp(readyPlayers.Count / PlayersPerTraitor,
MinTraitors, readyPlayers.Count);
for (var i = 0; i < numTraitors; i++)