Going to bed but i wanna show off my cool debugging system
This commit is contained in:
@@ -1,29 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
namespace Awperative;
|
||||
|
||||
public sealed partial class Body
|
||||
public sealed partial class Body
|
||||
{
|
||||
|
||||
public readonly Scene scene;
|
||||
public readonly Transform transform = new Transform();
|
||||
|
||||
public readonly List<string> tags = [];
|
||||
|
||||
public readonly List<Component> components = [];
|
||||
/// <summary>
|
||||
/// Current scene the body exists in
|
||||
/// </summary>
|
||||
public Scene Scene { get; internal set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// All components attached to the body
|
||||
/// </summary>
|
||||
public List<Component> Components => _components.ToList();
|
||||
internal HashSet<Component> _components { get; private set; } = [];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// All tags attached to the body
|
||||
/// </summary>
|
||||
public List<string> Tags => _tags.ToList();
|
||||
internal HashSet<string> _tags { get; private set; }= [];
|
||||
|
||||
public Body(Scene __scene) {
|
||||
scene = __scene;
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Position of the body
|
||||
/// </summary>
|
||||
public Transform transform { get; internal set; } = new();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Prevents outside construction
|
||||
internal Body() {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a body in the given scene
|
||||
/// </summary>
|
||||
/// <param name="__scene"></param>
|
||||
internal Body(Scene __scene) {
|
||||
Scene = __scene;
|
||||
}
|
||||
|
||||
public Body(Scene __scene, Transform __transform) {
|
||||
scene = __scene;
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a body with a scene and transform
|
||||
/// </summary>
|
||||
/// <param name="__scene"></param>
|
||||
/// <param name="__transform"></param>
|
||||
internal Body(Scene __scene, Transform __transform) {
|
||||
Scene = __scene;
|
||||
transform = __transform;
|
||||
}
|
||||
|
||||
|
||||
//todo: make internal
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
|
||||
@@ -6,13 +7,13 @@ namespace Awperative;
|
||||
|
||||
public sealed partial class Body
|
||||
{
|
||||
public void Unload() { foreach (Component component in components) component.Unload(); }
|
||||
public void Unload() { foreach (Component component in components.ToList()) component.Unload(); }
|
||||
|
||||
public void Load() { foreach (Component component in components) { component.Load(); } }
|
||||
public void Load() { foreach (Component component in components.ToList()) { component.Load(); } }
|
||||
|
||||
public void Update(GameTime __gameTime) { foreach (Component component in components) { component.Update(__gameTime); } }
|
||||
public void Draw(GameTime __gameTime) { foreach (Component component in components) { component.Draw(__gameTime); } }
|
||||
public void Update(GameTime __gameTime) { foreach (Component component in components.ToList()) { component.Update(__gameTime); } }
|
||||
public void Draw(GameTime __gameTime) { foreach (Component component in components.ToList()) { component.Draw(__gameTime); } }
|
||||
|
||||
public void Destroy() { foreach(Component component in components) component.Destroy(); }
|
||||
public void Create() { foreach (Component component in components) component.Create(); }
|
||||
public void Destroy() { foreach(Component component in components.ToList()) component.Destroy(); }
|
||||
public void Create() { foreach (Component component in components.ToList()) component.Create(); }
|
||||
}
|
||||
Reference in New Issue
Block a user