Removed Initialize()
This commit is contained in:
@@ -6,7 +6,6 @@ namespace Awperative;
|
||||
|
||||
public sealed partial class Body
|
||||
{
|
||||
public void Initialize() { foreach (Component component in components) component.Initialize(); }
|
||||
public void Terminate() { foreach (Component component in components) component.Terminate(); }
|
||||
|
||||
public void Load() { foreach (Component component in components) { component.Load(); } }
|
||||
|
||||
@@ -5,10 +5,6 @@ namespace Awperative;
|
||||
|
||||
public sealed partial class Scene
|
||||
{
|
||||
public void Initialize() {
|
||||
foreach (Behavior behavior in behaviors) behavior.Initialize();
|
||||
foreach (Body body in bodies) body.Initialize();
|
||||
}
|
||||
|
||||
public void Terminate() {
|
||||
foreach (Behavior behavior in behaviors) behavior.Terminate();
|
||||
|
||||
@@ -8,15 +8,10 @@ public interface AwperativeHook
|
||||
/// <summary>
|
||||
/// Called when the program starts; It is not recommended you load assets here.
|
||||
/// </summary>
|
||||
public void Initialize() {}
|
||||
public void Load() {}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the program closes.
|
||||
/// </summary>
|
||||
public void Terminate() {}
|
||||
|
||||
/// <summary>
|
||||
/// Called when Awperative loads content.
|
||||
/// </summary>
|
||||
public void Load() {}
|
||||
}
|
||||
@@ -20,15 +20,14 @@ public sealed class Base : Game
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize() is called when the program starts. Override Initialize() in scripting tools or use hooks to call from this event.
|
||||
/// 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
|
||||
/// </summary>
|
||||
/// <remarks> It is recommended not to load content in Initialize()</remarks>
|
||||
protected override void Initialize() {
|
||||
Awperative.ContentManager = Content;
|
||||
Awperative.SpriteBatch = new SpriteBatch(GraphicsDevice);
|
||||
|
||||
foreach (AwperativeHook hook in Awperative.EventHooks) hook.Initialize();
|
||||
foreach(Scene scene in Awperative.LoadedScenes) scene.Initialize();
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ public abstract class Behavior
|
||||
|
||||
|
||||
//GAME HAS JUST BEGUN/ended
|
||||
public virtual void Initialize() {}
|
||||
public virtual void Terminate() {}
|
||||
|
||||
//WE ARE LOADING STUFF
|
||||
|
||||
@@ -53,7 +53,6 @@ public abstract class Component
|
||||
|
||||
|
||||
//GAME HAS JUST BEGUN/ended
|
||||
public virtual void Initialize() {}
|
||||
public virtual void Terminate() {}
|
||||
|
||||
//WE ARE LOADING STUFF
|
||||
|
||||
Reference in New Issue
Block a user