using Microsoft.Xna.Framework; namespace Awperative; public abstract class Behavior { public Scene scene; public bool Enabled = false; public bool EnforceSingleton = false; public int Priority = 0; //scene relay protected Body AddBody() => scene.AddBody(); protected Body AddBody(Transform __transform) => scene.AddBody(__transform); protected Body GetBody(string __tag) => scene.GetBody(__tag); protected Body[] GetBodies(string __tag) => scene.GetBodies(__tag); protected void DestroyBody(Body __body) => scene.DestroyBody(__body); protected Generic AddBehavior() where Generic : Behavior => scene.AddBehavior(); protected Generic AddBehavior(object[] __args) where Generic : Behavior => scene.AddBehavior(__args); protected Generic GetBehavior() where Generic : Behavior => scene.GetBehavior(); protected Generic[] GetBehaviors() where Generic : Behavior => scene.GetBehaviors(); protected void RemoveBehavior() where Generic : Behavior => scene.RemoveBehavior(); //GAME HAS JUST BEGUN/ended public virtual void Unload() {} //WE ARE LOADING STUFF public virtual void Load() {} //You know what these do public virtual void Update(GameTime __gameTime) {} public virtual void Draw(GameTime __gameTime) {} //component/body/scene is being created or destroyed public virtual void Create() {} public virtual void Destroy() {} //New behavior functionality internal void Initiate(Scene __scene) { scene = __scene; Create(); } //destroy behavior functionality internal void End() { Destroy(); } }