PetPrograms

public final class PetPrograms

One Mind program per species and variant, assembled from the catalog's modules and built once, with the settings each module reads as c.settings. A pet instantiates its own copy (Lua state is per pet; compiled code is shared).

A PetPrograms belongs to one catalog load and says each warning once for that load. Use it on the main thread only, and outside Lua Mind callbacks: building a program runs Lua, which inside a callback would share that callback's budget. The first call for a species and variant decides its program; later calls get that program whatever entries and file name they pass.

Constructors

Link copied to clipboard
public void PetPrograms(PetBehaviorCatalog catalog, Consumer<String> warn)

Types

Link copied to clipboard
public final class Program extends Record
A creature's program, and the settings of each module it runs by module id.

Functions

Link copied to clipboard
public static List<PetBehaviorEntry> defaults(MindBodyLocomotion locomotion)
The list a species without one runs, by how its body moves.
Link copied to clipboard
public PetPrograms.Program program(String species, String variant, List<PetBehaviorEntry> entries, String where)
The program for one variant of a species, from its list: the species' entries, then the variant's.