Skip to content

ModuleAssemblies

namespace Griff;
public static class ModuleAssemblies

The assemblies Griff’s modules run from (see Griff.Runtime.GameModule). A module’s running parts are an assembly of their own, Griff.Modules.<Genre>, and its editor parts another beside it (Griff.Modules.<Genre>.Editor), so Griff names none of them: a program plays with the module assemblies it has, found by their names beside it (the editor, the tests and the tools have them all), and an exported game’s host loads those its export carries (Load: the modules its project uses, in its game folder’s ExportLayout.ModulesFolder) before it reads the game. What’s worked out from them (GameModule.All, the components every game knows, the dialogue tags modules do) follows Revision.

public static IReadOnlyList<Assembly> All { get; }

The module assemblies this program plays with: those beside it, and any a host has loaded since.

public static int Revision { get; }

Changes whenever a host loads more module assemblies, so what was worked out from them is again.

public static bool IsGriffs(Type type)

Whether type is Griff’s own or a module’s, rather than a script’s.

public static bool IsModule(Assembly assembly)

Whether assembly is a module’s running parts (not its editor parts).

public static bool IsModuleName(string? name)

Whether an assembly called name is a module’s running parts: “Griff.Modules.Match3”.

public static IReadOnlyList<Assembly> Load(string folder)

Loads the module assemblies in folder (an exported game’s ExportLayout.ModulesFolder) that aren’t loaded yet, each once, from their bytes (so the files aren’t held while the game runs). Returns them all, those that were already loaded too. A folder that isn’t there has none.

public static Assembly Load(string name, byte[] image)

Loads the module assembly called name from image (one a browser fetched with its game, “Griff.Modules.Match3”), unless one of that name is loaded already, which it returns.

public const string EditorSuffix

What a module’s editor parts’ assembly is called after its module’s: “.Editor”.

public const string Prefix

What a module’s running assembly is called before its genre: “Griff.Modules.”.