Commit Description:
Fixes to package script.
Commit Description:
Fixes to package script.
File last commit:
Show/Diff file:
Action:
isometric-park-fna/MathUtils.cs
47 lines | 805 B | text/x-csharp | CSharpLexer
using System;
namespace isometricparkfna
{
public class MathUtils
{
public MathUtils()
{
}
public static bool Between(float val, float x, float y)
{
return ((x < val && val < y) || (y < val && val < x));
}
public static bool Between(int val, int x, int y)
{
return ((x < val && val < y) || (y < val && val < x));
}
protected float Decrement(float value, float delta)
{
float magnitude = Math.Abs(value);
//If distance from zero is less than our delta,
//go to zero to prevent overshooting:
if (magnitude < delta)
{
return 0.0f;
}
else if (value > 0)
{
return value - delta;
}
else if (value < 0)
{
return value + delta;
}
else
{
return 0.0f;
}
}
}
}