diff --git a/Source/MonoGame.Extended.Entities/Entity.cs b/Source/MonoGame.Extended.Entities/Entity.cs index f8facf6d..c35f0122 100644 --- a/Source/MonoGame.Extended.Entities/Entity.cs +++ b/Source/MonoGame.Extended.Entities/Entity.cs @@ -166,7 +166,7 @@ namespace MonoGame.Extended.Entities public override string ToString() { - return $"{RuntimeHelpers.GetHashCode(this):X8}"; + return $"{RuntimeHelpers.GetHashCode(this):X8} {Name}"; } void IPoolable.Initialize(ReturnToPoolDelegate returnDelegate) diff --git a/Source/MonoGame.Extended.Entities/EntityManager.cs b/Source/MonoGame.Extended.Entities/EntityManager.cs index f38bff99..41d6777b 100644 --- a/Source/MonoGame.Extended.Entities/EntityManager.cs +++ b/Source/MonoGame.Extended.Entities/EntityManager.cs @@ -91,9 +91,10 @@ namespace MonoGame.Extended.Entities return new Entity(_systemManager.ProcessingSystems.Count, _componentTypes.Count); } - public Entity CreateEntity() + public Entity CreateEntity(string name = null) { var entity = _pool.New(); + entity.Name = name; MarkEntityToBeAdded(entity); return entity; } diff --git a/Source/MonoGame.Extended.Entities/EntityProcessingSystem.cs b/Source/MonoGame.Extended.Entities/EntityProcessingSystem.cs index 7b70133b..741d2b0a 100644 --- a/Source/MonoGame.Extended.Entities/EntityProcessingSystem.cs +++ b/Source/MonoGame.Extended.Entities/EntityProcessingSystem.cs @@ -80,7 +80,9 @@ namespace MonoGame.Extended.Entities } } - protected abstract void Process(GameTime gameTime, Entity entity); + protected virtual void Process(GameTime gameTime, Entity entity) + { + } protected bool IsInterestedIn(Entity entity) { diff --git a/Source/MonoGame.Extended/Transform.cs b/Source/MonoGame.Extended/Transform.cs index 2eb577d4..6f9f29cc 100644 --- a/Source/MonoGame.Extended/Transform.cs +++ b/Source/MonoGame.Extended/Transform.cs @@ -208,6 +208,13 @@ namespace MonoGame.Extended private float _rotation; private Vector2 _scale = Vector2.One; + public Transform2D(Vector2? position = null, float rotation = 0, Vector2? scale = null) + { + Position = position ?? Vector2.Zero; + Rotation = rotation; + Scale = scale ?? Vector2.One; + } + /// /// Gets the world position. ///