Spending/Progressions.cs
using System;

namespace PlanetMeat;

public static class Progressions
{
	// https://www.desmos.com/calculator/omqcpghpkb

	public static int Intify( float value, int min = 1 ) => Math.Max( min, (int)MathF.Round( value ) );
	public static int Intify( double value, int min = 1 ) => Math.Max( min, (int)Math.Round( value ) );
	public static int Intify( Func<double, double> p, double x, int min = 1 ) => Intify( p( Math.Floor( x ) ), min );

	public static double Exponential( double x ) => Math.Pow( 2.0, x );

	public static double StairSlow( double x ) => Exponential( Math.Floor( Math.Sqrt( x ) ) - 1.0 );
	public static int StairSlowInt( double x ) => Intify( StairSlow, x );

	public static double StairCrawl( double x ) => Math.Ceiling( Math.Sqrt( StairSlow( x ) ) );
	public static int StairCrawlInt( double x ) => Intify( StairCrawl, x );

	public static double ExpSlow( double x ) => Exponential( Math.Sqrt( x ) - 1.0 );
	public static int ExpSlowInt( double x ) => Intify( ExpSlow, x );
	public static double ExpCrawl( double x ) => Math.Sqrt( ExpSlow( x ) );
	public static int ExpCrawlInt( double x ) => Intify( ExpCrawl, x );

	public static double PowLog( double x ) => x < 1.0 ? x : Math.Pow( x, Math.Log( x, 100.0 ) );
	public static double PowLogZeroed( double x ) => x < 0.1 ? x : PowLog( x ) - 0.9;
}