Module generators

Types

GeneratorType = enum
  gtSimple, gtNoise
Generator[T] = ref object
  case kind*: GeneratorType
  of gtSimple:
      simple_callback*: proc (x, y: int): T

  of gtNoise:
      noise_callback*: proc (x, y: int; noise: float): T

  

Procs

proc `()`[T](gen: Generator[T]; x, y: int; noise = - 1.0'f64): T
proc SimpleGenerator[T](cb: proc (x, y: int): T): Generator[T]
proc NoiseGenerator[T](cb: proc (x, y: int; noise: float): T): Generator[T]
proc newStaticGenerator[T](value: T): Generator[T]
proc newRandomGenerator[T](values: seq[Generator[T]]): Generator[T]
proc newWeightedGenerator[T](choices: seq[(int, Generator[T])]): Generator[T]
proc newBitonalGenerator[T](a, b: Generator[T]; scale = 1.0'f64): Generator[T]
proc newRangedGenerator[T](ranges: seq[(int, Generator[T])]; scale = 1.0'f64;
                          jitter = 0.0'f64; child = false): Generator[T]
proc newBillowGenerator[T](generators: seq[Generator[T]]; scale = 1.0'f64;
                          jitter = 0.0'f64): Generator[T]