using NewMoon.TF2Helpers;
namespace NewMoon.Samples.CustomNpc;
///
/// A light sample gamemode that registers one custom NPC classname, nm_sample_npc, which fronts base_boss.
///
///
/// The generator emits NewMoon.Generated.CustomEntityTable.All for this assembly, one descriptor per [CustomEntity]
/// class. hands them to the registry, which installs the classname as a factory
/// alias of base_boss. The plugin scope removes the alias, and despawns the live NPCs, when the plugin unloads.
///
[GameMode("Custom NPC Sample", "custom-npc-sample", Description = "Registers one custom NPC classname fronting base_boss.")]
public sealed partial class CustomNpcSample : FGamePlugin
{
///
protected override void OnPluginStart()
{
// The logger is set first: adoption inside the registration can raise OnSpawn for NPCs that already exist.
SampleNpc.Log = PLogger;
PLogger.LogRegistered(RegisterCustomEntities(NewMoon.Generated.CustomEntityTable.All));
}
///
protected override void OnPluginEnd() => PLogger.LogEnded();
}