Changed terminate into unload

This commit is contained in:
2026-01-30 20:42:33 -05:00
parent 82fa3a02c2
commit 6370a70e77
6 changed files with 10 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ namespace Awperative;
public sealed partial class Body
{
public void Terminate() { foreach (Component component in components) component.Terminate(); }
public void Unload() { foreach (Component component in components) component.Unload(); }
public void Load() { foreach (Component component in components) { component.Load(); } }

View File

@@ -6,9 +6,9 @@ namespace Awperative;
public sealed partial class Scene
{
public void Terminate() {
foreach (Behavior behavior in behaviors) behavior.Terminate();
foreach (Body body in bodies) body.Terminate();
public void Unload() {
foreach (Behavior behavior in behaviors) behavior.Unload();
foreach (Body body in bodies) body.Unload();
}
public void Load() {

View File

@@ -13,5 +13,5 @@ public interface AwperativeHook
/// <summary>
/// Called when the program closes.
/// </summary>
public void Terminate() {}
public void Unload() {}
}

View File

@@ -20,8 +20,7 @@ public sealed class Base : Game
}
/// <summary>
/// Initialize() is called when the program starts. It can be confusing because Initialize() in hooks and events is actually LoadContent().
/// This is because Initialize() has little utility and there is no reason to
/// Initialize() is called when the program starts. Goes before LoadContent(). And prepares the kernel for use.
/// </summary>
/// <remarks> It is recommended not to load content in Initialize()</remarks>
protected override void Initialize() {
@@ -65,7 +64,7 @@ public sealed class Base : Game
/// </summary>
/// <remarks> This event may not trigger if the program is force closed.</remarks>
protected override void EndRun() {
foreach (AwperativeHook hook in Awperative.EventHooks) hook.Terminate();
foreach (Scene scene in Awperative.LoadedScenes) scene.Terminate();
foreach (AwperativeHook hook in Awperative.EventHooks) hook.Unload();
foreach (Scene scene in Awperative.LoadedScenes) scene.Unload();
}
}

View File

@@ -37,7 +37,7 @@ public abstract class Behavior
//GAME HAS JUST BEGUN/ended
public virtual void Terminate() {}
public virtual void Unload() {}
//WE ARE LOADING STUFF
public virtual void Load() {}

View File

@@ -53,7 +53,7 @@ public abstract class Component
//GAME HAS JUST BEGUN/ended
public virtual void Terminate() {}
public virtual void Unload() {}
//WE ARE LOADING STUFF
public virtual void Load() {}