Close we are CLOSE

This commit is contained in:
2026-02-13 22:19:55 -05:00
parent bdd9b7bed8
commit 6cb3c2e53f
5 changed files with 120 additions and 29 deletions

View File

@@ -14,43 +14,80 @@ namespace Awperative;
/// </summary>
public abstract partial class Behavior : Docker
{
public Scene Scene;
public Behavior Parent = null;
//todo tags and order
internal void Initiate(Scene __scene, Docker __parent) {
Scene = __scene;
if (__parent is Behavior behavior) Parent = behavior;
/// <summary>
/// Current parent of the Behavior. Can be either Scene or another Behavior.
/// </summary>
internal Docker Docker;
/// <summary>
/// Identifiers for Behaviors.
/// </summary>
public List<string> Tags;
/// <summary>
/// Order for when Behaviors are called on. Only applies between Components on the same Docker.
/// </summary>
public int Priority;
/// <summary>
/// To be called when the Behavior is created.
/// </summary>
/// <param name="__parent"> Docker that this spawned in this Behavior</param>
internal void Initiate(Docker __parent) {
Docker = __parent;
Create();
}
internal void End() {
Destroy();
}
/// <summary>
/// Called when the Game is Closing; does not always happen depending on if it is Force Closed.
/// </summary>
protected internal virtual void Unload() {}
/// <summary>
/// Called when the Game is Loading.
/// </summary>
protected internal virtual void Load() {}
//You know what these do
protected internal virtual void Update(GameTime __gameTime) {}
protected internal virtual void Draw(GameTime __gameTime) {}
//component/body/scene is being created or destroyed
/// <summary>
/// Called every frame before Draw, it is recommended to do any Non-Drawing update logic here.
/// </summary>
protected internal virtual void Update() {}
/// <summary>
/// Called after Update when the screen is being drawn. Please only put Drawing related logic here.
/// </summary>
protected internal virtual void Draw() {}
/// <summary>
/// Called when the Component is created.
/// </summary>
protected internal virtual void Create() {}
/// <summary>
/// Called when the Component is destroyed. Not called when the Game is closed.
/// </summary>
protected internal virtual void Destroy() {}
}