ModelCooking class final

Import settings and cooking for the project's models, on disk.

A model's settings live beside it (<model>.import.json) and its cooked copy too (<model>.jmodel), which the game loads in its place. A model with neither is used as it is; one with settings is cooked when they are saved, and again whenever the file or the settings change (isStale).

Constructors

ModelCooking({required String root})
Cooking for the project at root.

Properties

hashCode → int
The hash code for this object.
no setterinherited
root → String
The project folder.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

cook(String path) → Future<CookedResult>
Cooks the model at path with its settings, writing its cooked copy.
cookStale(Iterable<String> paths) → Future<(List<String>, Map<String, Object>)>
Cooks each of paths that isStale; the ones cooked, with what failed by path.
hasSettings(String path) → bool
Whether the model at path has settings of its own.
isCooked(String path) → bool
Whether the model at path has a cooked copy.
isStale(String path) → bool
Whether the model at path is to be cooked and its cooked copy is missing or was made from another file or other settings.
modelsUnder(String folder) → List<String>
The model files under folder (project-relative), recursively.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
saveSettings(String path, ModelImportSettings settings) → Future<void>
Saves settings beside the model at path.
settingsOf(String path) → ModelImportSettings
The settings of the model at path: its sidecar's, or the defaults.
toString() → String
A string representation of this object.
inherited
uncook(String path) → Future<void>
Deletes the cooked copy of the model at path: the game loads the file itself again. Its settings stay.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

isModel(String path) → bool
Whether path is a model file it cooks.