Skip to content

Type Alias: FeatureGate

ts
type FeatureGate = 
  | {
  mode: "forbidden";
}
  | {
  mode: "required";
  range: NumericRange;
}
  | {
  mode: "allowed";
  probability: number;
  range: NumericRange;
};

Resolution rule for an optional body feature (atmosphere, liquid, rings…). The seed PRNG resolves the gate before any range is drawn:

  • forbidden: the feature is never present; matching ranges are skipped.
  • required: the feature is always present; values drawn within range.
  • allowed: the seed rolls a coin biased by probability. If kept, values are drawn within range; otherwise the feature is treated as absent (range pick skipped).

range is the value range used only when the feature ends up present. Probabilities outside [0, 1] are clamped by the generator.

Distribué sous la licence indiquée dans le dépôt.