Repository navigation
Recipes
Michael Yarichuk edited this page Oct 18, 2026
·
1 revision
repository.TryGetByName("goblin", out var t); // O(1), case-insensitive
var melee = repository.GetByTags("enemy", "melee"); // ALL tags required
var all = repository.GetByTags(); // everythingOn live entities: entity.HasTags("enemy"), parent.GetChildrenWithTags("enemy").
Inheritance is cached, dice and scripts are parsed once per distinct source, so spawning thousands of the same blueprint stays flat.
There is no built-in save format. Persist the template name plus dynamic state, then re-spawn and re-apply:
// save
Save(templateName, entity.Get<Health>().Current, entity.Get<Position>());
// load
factory.TryCreate(savedTemplateName, out var e);
e.Set(new Health { Current = savedHp, Max = savedMax });await repository.LoadTemplateFolderAsync("Mods/Extra", ct);Loading is additive and atomic. There is no unload: to hot-reload, build a fresh EntityTemplateRepository + EntityFactory and drop the old pair. If you mutate a loaded template in place, call factory.InvalidateEffectiveTemplateCache().
var rng = new Random(seed);
dice.Roll(rng);RoguelikeToolkit.Entities