Pack constructor

Pack({
  1. required String name,
  2. File? main,
  3. File? load,
  4. List<File>? files,
  5. List<Module>? modules,
})

A pack is logically the next step after a Project. This defines a sub-pack with an name again that will be our namespace afterwards.

Here we can also define included files as well as the main and load function:

Pack(
	name:"tpcraft",
	main: File(...),
	load: File(...),
	files: List<File> [
		File(...)
	]
)

Implementation

Pack({required this.name, this.main, this.load, this.files, this.modules}) {
  if (name != name.toLowerCase()) {
    throw ('Please not that the name of a pack must be lowercase! for pack:$name');
  }
  if (modules != null) {
    if (main == null) {
      main = File('main', child: For.of(modules!));
    } else {
      main!.child = For.of([
        ...modules!,
        if (main!.child != null) main!.child!,
      ]);
    }
  }
}