diff --git a/src/Apps/GameDesktop/CompositionRoots/Components/ComponentsCompositionRoot.cs b/src/Apps/GameDesktop/CompositionRoots/Components/ComponentsCompositionRoot.cs index 2b98dd9..44688db 100644 --- a/src/Apps/GameDesktop/CompositionRoots/Components/ComponentsCompositionRoot.cs +++ b/src/Apps/GameDesktop/CompositionRoots/Components/ComponentsCompositionRoot.cs @@ -39,12 +39,12 @@ private static void RegisterDataComponents(IServiceRegistry serviceRegistry) private static void RegisterItemComponent(IServiceRegistry serviceRegistry) { // TODO: make this accessible globally? So, the name, etc. of an item are reused between classes easily - Dictionary items = new() - { - { ItemId.Rock, new Item(name: "Rock", isStackable: true, maximumInStack: 16) } - }; + // Dictionary items = new() + // { + // { ItemId.Rock, new Item(name: "Rock", isStackable: true, maximumInStack: 16) } + // }; - serviceRegistry.RegisterSingleton(_ => new ItemComponent(ItemId.Rock), "Rock"); + serviceRegistry.RegisterSingleton(_ => new ItemComponent(ItemId.Rock), ItemsTable.Items[ItemId.Rock].Name); } private static void RegisterTagComponents(IServiceRegistry serviceRegistry) diff --git a/src/Apps/GameDesktop/CompositionRoots/Entities/PlayerEntityCompositionRoot.cs b/src/Apps/GameDesktop/CompositionRoots/Entities/PlayerEntityCompositionRoot.cs index e709e8c..f6c1a89 100644 --- a/src/Apps/GameDesktop/CompositionRoots/Entities/PlayerEntityCompositionRoot.cs +++ b/src/Apps/GameDesktop/CompositionRoots/Entities/PlayerEntityCompositionRoot.cs @@ -17,6 +17,7 @@ public void Compose(IServiceRegistry serviceRegistry) private static void RegisterEntity(IServiceRegistry serviceRegistry) => serviceRegistry.RegisterTransient(factory => new PlayerEntityFactory( + new NameComponent("Player"), // factory.GetInstance("Player"), factory.GetInstance(), factory.GetInstance(), factory.GetInstance("PlayerEntity"), diff --git a/src/Apps/GameDesktop/CompositionRoots/Entities/RootFeatureCompositionRoot.cs b/src/Apps/GameDesktop/CompositionRoots/Entities/RootFeatureCompositionRoot.cs index cdcb8df..d496775 100644 --- a/src/Apps/GameDesktop/CompositionRoots/Entities/RootFeatureCompositionRoot.cs +++ b/src/Apps/GameDesktop/CompositionRoots/Entities/RootFeatureCompositionRoot.cs @@ -14,10 +14,11 @@ using Scellecs.Morpeh; using Services.Movement; using Systems; -using Systems.Debugging; -using Systems.Debugging.Render; using Systems.Render; #if DEBUG +using Features.Debugging; +using Systems.Debugging; +using Systems.Debugging.Render; using GameDesktop.CompositionRoots.DebugFeatures; #endif @@ -104,7 +105,7 @@ private static void RegisterEntryPoint(IServiceRegistry serviceRegistry) pixel.SetData(new[] { Color.Gold }); return new RootFeature(factory.GetInstance(), - new WorldInitializer(factory.GetInstance(), new WorldEntityFactory(new WorldComponent()), + new WorldInitializer(factory.GetInstance(), new WorldEntityFactory(new WorldMetaComponent()), factory.GetInstance(), factory.GetInstance(), factory.GetInstance()), diff --git a/src/Apps/GameDesktop/CompositionRoots/Entities/StaticEntityCompositionRoot.cs b/src/Apps/GameDesktop/CompositionRoots/Entities/StaticEntityCompositionRoot.cs index 426b2a5..054ee00 100644 --- a/src/Apps/GameDesktop/CompositionRoots/Entities/StaticEntityCompositionRoot.cs +++ b/src/Apps/GameDesktop/CompositionRoots/Entities/StaticEntityCompositionRoot.cs @@ -17,6 +17,7 @@ public void Compose(IServiceRegistry serviceRegistry) private static void RegisterEntity(IServiceRegistry serviceRegistry) => serviceRegistry.RegisterTransient(factory => new DummyEntityFactory( + new NameComponent("Dummy"), // factory.GetInstance("Dummy") factory.GetInstance("DummyEntity"), factory.GetInstance(), factory.GetInstance())); diff --git a/src/Apps/GameDesktop/CompositionRoots/Features/RockEntityCompositionRoot.cs b/src/Apps/GameDesktop/CompositionRoots/Features/RockEntityCompositionRoot.cs index 373b760..6a2a7c8 100644 --- a/src/Apps/GameDesktop/CompositionRoots/Features/RockEntityCompositionRoot.cs +++ b/src/Apps/GameDesktop/CompositionRoots/Features/RockEntityCompositionRoot.cs @@ -15,6 +15,7 @@ public void Compose(IServiceRegistry serviceRegistry) private static void RegisterEntity(IServiceRegistry serviceRegistry) => serviceRegistry.RegisterTransient(factory => new RockEntityFactory( + new NameComponent("Rock"), // factory.GetInstance("Rock") factory.GetInstance("Rock"), factory.GetInstance("RockEntity"), factory.GetInstance() //factory.GetInstance("Rock") diff --git a/src/Libs/Components/Data/CameraComponent.cs b/src/Libs/Components/Data/CameraComponent.cs index 459760f..fb3e7ae 100644 --- a/src/Libs/Components/Data/CameraComponent.cs +++ b/src/Libs/Components/Data/CameraComponent.cs @@ -1,13 +1,15 @@ -// namespace Entitas.Components.Data; -// -// [Unique] -// public class CameraComponent : IComponent -// { -// public Rectangle Size; -// } +using System.Numerics; +using Microsoft.Xna.Framework.Graphics; +using Scellecs.Morpeh; -// Camera is a system but a component, +namespace Components.Data; + +// TODO: Camera is a system and not a component, // So, the system would have a target as a dependency, // And exist only in the current world, -// As well, the system has its own behaviour, -// Thus, there's no reason to migrate the component +// As well, the system has its own behaviour +public struct CameraComponent(Viewport viewport) : IComponent +{ + public Viewport Viewport = viewport; + public Vector2 Position; +} diff --git a/src/Libs/Components/Data/ItemComponent.cs b/src/Libs/Components/Data/ItemComponent.cs index ac8c6ff..2753057 100644 --- a/src/Libs/Components/Data/ItemComponent.cs +++ b/src/Libs/Components/Data/ItemComponent.cs @@ -2,6 +2,7 @@ namespace Components.Data; +// TODO: refactor here a lil bit public enum ItemId { Rock = 0, @@ -12,9 +13,32 @@ public readonly struct ItemComponent(ItemId itemId) : IComponent public ItemId ItemId { get; } = itemId; } -public readonly struct Item(string name, bool isStackable, int? maximumInStack) +public readonly struct Item(string name) { public string Name { get; } = name; - public bool IsStackable { get; } = isStackable; - public int MaximumInStack { get; } = maximumInStack ?? 1; + public int MaximumInStack { get; } = 1; + public bool IsStackable { get; } = false; + + public Item(string name, int maximumInStack) : this(name) + { + Name = name; + MaximumInStack = maximumInStack; + + IsStackable = maximumInStack switch + { + > 1 => true, + < 1 => throw new ArgumentOutOfRangeException(nameof(maximumInStack), maximumInStack, + "Has to be >= 1"), + _ => IsStackable + }; + } +} + +// TODO: put in data tables namespace (?) +public static class ItemsTable +{ + public static readonly Dictionary Items = new() + { + { ItemId.Rock, new Item(name: "Rock", maximumInStack: 16) } + }; } diff --git a/src/Libs/Components/Data/NameComponent.cs b/src/Libs/Components/Data/NameComponent.cs new file mode 100644 index 0000000..a2eb3ef --- /dev/null +++ b/src/Libs/Components/Data/NameComponent.cs @@ -0,0 +1,8 @@ +using Scellecs.Morpeh; + +namespace Components.Data; + +public readonly struct NameComponent(string name) : IComponent +{ + public string Name { get; } = name; +} diff --git a/src/Libs/Components/Data/WorldComponent.cs b/src/Libs/Components/Data/WorldMetaComponent.cs similarity index 65% rename from src/Libs/Components/Data/WorldComponent.cs rename to src/Libs/Components/Data/WorldMetaComponent.cs index fa8854b..243c182 100644 --- a/src/Libs/Components/Data/WorldComponent.cs +++ b/src/Libs/Components/Data/WorldMetaComponent.cs @@ -2,7 +2,7 @@ namespace Components.Data; -public struct WorldComponent() : IComponent +public struct WorldMetaComponent() : IComponent { public float FramesPerSec; } diff --git a/src/Libs/Components/Render/Animation/MovementAnimationsComponent.cs b/src/Libs/Components/Render/Animation/MovementAnimationsComponent.cs index 6c8177f..02f134b 100644 --- a/src/Libs/Components/Render/Animation/MovementAnimationsComponent.cs +++ b/src/Libs/Components/Render/Animation/MovementAnimationsComponent.cs @@ -1,32 +1,4 @@ -// namespace Entitas.Components.Data -// { -// public class MovementAnimationComponent : RenderComponent -// { -// private const Direction DefaultFacing = Direction.Down; -// -// public AnimatedSprite? PlayingAnimation; -// public Dictionary? IdleAnimations; -// public Dictionary? WalkingAnimations; -// -// public Vector2 FacingDirection = Vector2.UnitY; -// public bool HasStopped; -// -// public MovementAnimationComponent() -// { -// } -// -// public MovementAnimationComponent(Dictionary idleAnimations, -// Dictionary walkingAnimations) -// { -// IdleAnimations = idleAnimations; -// WalkingAnimations = walkingAnimations; -// -// PlayingAnimation = idleAnimations[DefaultFacing]; -// } -// } -// } - -using Scellecs.Morpeh; +using Scellecs.Morpeh; using MonoGame.Aseprite.Sprites; using Services.Math; @@ -40,5 +12,3 @@ public struct MovementAnimationsComponent( public readonly Dictionary IdleAnimations = idleAnimations; public readonly Dictionary WalkingAnimations = walkingAnimations; } - -// CharacterAnimatorComponent diff --git a/src/Libs/Components/Tags/CameraComponent.cs b/src/Libs/Components/Tags/CameraComponent.cs deleted file mode 100644 index e5cef6a..0000000 --- a/src/Libs/Components/Tags/CameraComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Numerics; -using Microsoft.Xna.Framework.Graphics; -using Scellecs.Morpeh; - -namespace Components.Tags; - -public struct CameraComponent(Viewport viewport) : IComponent -{ - public Viewport Viewport = viewport; - public Vector2 Position; -} diff --git a/src/Libs/Components/Tags/InputMovableComponent.cs b/src/Libs/Components/Tags/InputMovableComponent.cs index 919c455..c1a0c19 100644 --- a/src/Libs/Components/Tags/InputMovableComponent.cs +++ b/src/Libs/Components/Tags/InputMovableComponent.cs @@ -2,6 +2,4 @@ namespace Components.Tags; -public struct InputMovableComponent : IComponent -{ -} +public struct InputMovableComponent : IComponent; diff --git a/src/Libs/Components/Tags/MovableComponent.cs b/src/Libs/Components/Tags/MovableComponent.cs index 47b7281..cbb83ad 100644 --- a/src/Libs/Components/Tags/MovableComponent.cs +++ b/src/Libs/Components/Tags/MovableComponent.cs @@ -2,6 +2,4 @@ namespace Components.Tags; -public struct MovableComponent : IComponent -{ -} +public struct MovableComponent : IComponent; diff --git a/src/Libs/Components/Tags/RenderComponent.cs b/src/Libs/Components/Tags/RenderComponent.cs deleted file mode 100644 index e9e533a..0000000 --- a/src/Libs/Components/Tags/RenderComponent.cs +++ /dev/null @@ -1,18 +0,0 @@ -// namespace Entitas.Components.Tags -// { -// // Tag components are the empty ones and prefixed with is- (e.g. isPlayer) -// // When auto-generated -// public class RenderComponent : IComponent -// { -// } -// } - - -namespace Components.Tags -{ - using Scellecs.Morpeh; - - public struct RenderComponent : IComponent - { - } -} diff --git a/src/Libs/Components/Tags/RenderableComponent.cs b/src/Libs/Components/Tags/RenderableComponent.cs new file mode 100644 index 0000000..e0e9e41 --- /dev/null +++ b/src/Libs/Components/Tags/RenderableComponent.cs @@ -0,0 +1,5 @@ +using Scellecs.Morpeh; + +namespace Components.Tags; + +public struct RenderableComponent : IComponent; diff --git a/src/Libs/Entities/Factories/Characters/DummyEntityFactory.cs b/src/Libs/Entities/Factories/Characters/DummyEntityFactory.cs index 274aa1d..a4f2447 100644 --- a/src/Libs/Entities/Factories/Characters/DummyEntityFactory.cs +++ b/src/Libs/Entities/Factories/Characters/DummyEntityFactory.cs @@ -5,22 +5,19 @@ namespace Entities.Factories.Characters; -public class DummyEntityFactory : EntityFactory +public class DummyEntityFactory( + NameComponent name, + TransformComponent transform, + RectangleCollisionComponent rectangleCollision) + : EntityFactory { - private readonly TransformComponent _transform; private readonly SpriteComponent _sprite; - private readonly RectangleCollisionComponent _rectangleCollision; - public DummyEntityFactory(TransformComponent transform, - RectangleCollisionComponent rectangleCollision) - { - _transform = transform; - _rectangleCollision = rectangleCollision; - } - - public DummyEntityFactory(TransformComponent transform, + public DummyEntityFactory( + NameComponent name, + TransformComponent transform, SpriteComponent sprite, - RectangleCollisionComponent rectangleCollision) : this(transform, rectangleCollision) + RectangleCollisionComponent rectangleCollision) : this(name, transform, rectangleCollision) { _sprite = sprite; } @@ -31,8 +28,9 @@ protected override void AddTags(Entity e) protected override void AddData(Entity e) { - e.AddComponent(_transform); - e.AddComponent(_rectangleCollision); + e.AddComponent(name); + e.AddComponent(transform); + e.AddComponent(rectangleCollision); } protected override void AddRender(Entity e) diff --git a/src/Libs/Entities/Factories/Characters/PlayerEntityFactory.cs b/src/Libs/Entities/Factories/Characters/PlayerEntityFactory.cs index 04a8430..7997712 100644 --- a/src/Libs/Entities/Factories/Characters/PlayerEntityFactory.cs +++ b/src/Libs/Entities/Factories/Characters/PlayerEntityFactory.cs @@ -12,6 +12,7 @@ namespace Entities.Factories.Characters; // But also, for the factory, ig, the view of the entities class will change. // For now, Imma keep it as it is. public class PlayerEntityFactory( + NameComponent nameComponent, InputMovableComponent inputMovable, MovableComponent movable, TransformComponent transform, @@ -23,14 +24,16 @@ public class PlayerEntityFactory( private readonly MovementAnimationsComponent _movementAnimations; private readonly CharacterAnimatorComponent _characterAnimator; - public PlayerEntityFactory(InputMovableComponent inputMovable, + public PlayerEntityFactory( + NameComponent nameComponent, + InputMovableComponent inputMovable, MovableComponent movable, TransformComponent transform, CameraComponent cameraComponent, RectangleCollisionComponent rectangleCollision, MovementAnimationsComponent movementAnimations, CharacterAnimatorComponent characterAnimator, - InventoryComponent inventoryComponent) : this(inputMovable, movable, transform, cameraComponent, + InventoryComponent inventoryComponent) : this(nameComponent, inputMovable, movable, transform, cameraComponent, rectangleCollision, inventoryComponent) { _movementAnimations = movementAnimations; @@ -46,6 +49,7 @@ protected override void AddTags(Entity e) protected override void AddData(Entity e) { + e.AddComponent(nameComponent); e.AddComponent(transform); e.AddComponent(rectangleCollision); e.AddComponent(inventoryComponent); diff --git a/src/Libs/Entities/Factories/Items/RockEntityFactory.cs b/src/Libs/Entities/Factories/Items/RockEntityFactory.cs index 8e0f271..bcd7e1c 100644 --- a/src/Libs/Entities/Factories/Items/RockEntityFactory.cs +++ b/src/Libs/Entities/Factories/Items/RockEntityFactory.cs @@ -6,13 +6,15 @@ namespace Entities.Factories.Items; public class RockEntityFactory( + NameComponent nameComponent, ItemComponent itemComponent, TransformComponent transformComponent) : EntityFactory { private readonly SpriteComponent _spriteComponent; - public RockEntityFactory(ItemComponent itemComponent, TransformComponent transformComponent, - SpriteComponent spriteComponent) : this(itemComponent, transformComponent) + public RockEntityFactory(NameComponent nameComponent, ItemComponent itemComponent, + TransformComponent transformComponent, + SpriteComponent spriteComponent) : this(nameComponent, itemComponent, transformComponent) { _spriteComponent = spriteComponent; } @@ -23,6 +25,7 @@ protected override void AddTags(Entity e) protected override void AddData(Entity e) { + e.AddComponent(nameComponent); e.AddComponent(itemComponent); e.AddComponent(transformComponent); } diff --git a/src/Libs/Entities/Factories/Meta/WorldEntityFactory.cs b/src/Libs/Entities/Factories/Meta/WorldEntityFactory.cs index 9c5e398..761f0ea 100644 --- a/src/Libs/Entities/Factories/Meta/WorldEntityFactory.cs +++ b/src/Libs/Entities/Factories/Meta/WorldEntityFactory.cs @@ -4,22 +4,15 @@ namespace Entities.Factories.Meta; -public class WorldEntityFactory : EntityFactory +public class WorldEntityFactory(WorldMetaComponent worldMetaComponent) : EntityFactory { - private readonly WorldComponent _worldComponent; - - public WorldEntityFactory(WorldComponent worldComponent) - { - _worldComponent = worldComponent; - } - protected override void AddTags(Entity e) { } protected override void AddData(Entity e) { - e.AddComponent(_worldComponent); + e.AddComponent(worldMetaComponent); } protected override void AddRender(Entity e) diff --git a/src/Libs/Features.Debugging/DebugFeature.cs b/src/Libs/Features.Debugging/DebugFeature.cs index 2bb858b..7a7ba12 100644 --- a/src/Libs/Features.Debugging/DebugFeature.cs +++ b/src/Libs/Features.Debugging/DebugFeature.cs @@ -3,7 +3,7 @@ using Systems.Debugging; using Systems.Debugging.Render; -namespace GameDesktop; +namespace Features.Debugging; public class DebugFeature : Feature { diff --git a/src/Libs/Features/Features.csproj b/src/Libs/Features/Features.csproj index 68915e7..8bfdeda 100644 --- a/src/Libs/Features/Features.csproj +++ b/src/Libs/Features/Features.csproj @@ -1,20 +1,22 @@ - - enable - enable - net8.0 - default - + + enable + enable + net8.0 + default + true + true + - - - - - + + + + + - - - + + + diff --git a/src/Libs/Features/RootFeature.cs b/src/Libs/Features/RootFeature.cs index 5e06c43..9e43fd8 100644 --- a/src/Libs/Features/RootFeature.cs +++ b/src/Libs/Features/RootFeature.cs @@ -1,4 +1,4 @@ -using GameDesktop; +using Features.Debugging; using Scellecs.Morpeh; using Scellecs.Morpeh.Extended; diff --git a/src/Libs/Systems.Debugging/EntitiesList.cs b/src/Libs/Systems.Debugging/EntitiesList.cs index 8192ca6..0a31863 100644 --- a/src/Libs/Systems.Debugging/EntitiesList.cs +++ b/src/Libs/Systems.Debugging/EntitiesList.cs @@ -31,7 +31,8 @@ public void OnUpdate(float deltaTime) foreach (Entity e in filter) { // TODO: By flag components I could decide what entity this is and show the proper name - if (!ImGui.CollapsingHeader($"Entity###{e.ID}")) // ### -> for identical values + string entityName = GetEntityName(e); + if (!ImGui.CollapsingHeader($"{entityName}###{e.ID}")) // ### -> for identical values { continue; } @@ -48,6 +49,12 @@ public void OnUpdate(float deltaTime) ImGui.End(); } + private static string GetEntityName(Entity entity) + { + ref NameComponent nameComponent = ref entity.GetComponent(); + return string.IsNullOrWhiteSpace(nameComponent.Name) ? "Entity" : nameComponent.Name; + } + private static void DrawComponentsList(Entity e) { // TODO: collect all the components' names automatically @@ -62,7 +69,7 @@ private static void DrawComponentsList(Entity e) { typeof(SpriteComponent), "Sprite" }, { typeof(InputMovableComponent), "Input Movable" }, { typeof(MovableComponent), "Movable" }, - { typeof(RenderComponent), "Render" }, + { typeof(RenderableComponent), "Renderable" }, }; foreach (var type in types.Where(type => e.Has(type.Key))) diff --git a/src/Libs/Systems.Debugging/FrameCounter.cs b/src/Libs/Systems.Debugging/FrameCounter.cs index 89468b2..b70043d 100644 --- a/src/Libs/Systems.Debugging/FrameCounter.cs +++ b/src/Libs/Systems.Debugging/FrameCounter.cs @@ -3,18 +3,13 @@ namespace Systems.Debugging; -public class FrameCounter : ISystem +public class FrameCounter(World world) : ISystem { private const float UpdateFrequencyInSec = .02f; private float _elapsedTime; private int _framesCount; - public World World { get; set; } - - public FrameCounter(World world) - { - World = world; - } + public World World { get; set; } = world; public void OnAwake() { @@ -30,9 +25,9 @@ public void OnUpdate(float deltaTime) return; } - ref WorldComponent world = - ref World.Filter.With().Build().First().GetComponent(); - world.FramesPerSec = _framesCount / _elapsedTime; + ref WorldMetaComponent worldMeta = + ref World.Filter.With().Build().First().GetComponent(); + worldMeta.FramesPerSec = _framesCount / _elapsedTime; _framesCount = 0; _elapsedTime = 0; diff --git a/src/Libs/Systems.Debugging/Render/RenderFramesPerSec.cs b/src/Libs/Systems.Debugging/Render/RenderFramesPerSec.cs index 25f1943..1e1416a 100644 --- a/src/Libs/Systems.Debugging/Render/RenderFramesPerSec.cs +++ b/src/Libs/Systems.Debugging/Render/RenderFramesPerSec.cs @@ -15,7 +15,7 @@ public void OnAwake() public void OnUpdate(float deltaTime) { - var world = World.Filter.With().Build().First().GetComponent(); + var world = World.Filter.With().Build().First().GetComponent(); ImGui.Begin("Diagnostics", ImGuiWindowFlags.NoBackground | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoDocking); diff --git a/src/UnitTests/UnitTests.Entities/PlayerEntity.cs b/src/UnitTests/UnitTests.Entities/PlayerEntity.cs index 5e3a190..e647190 100644 --- a/src/UnitTests/UnitTests.Entities/PlayerEntity.cs +++ b/src/UnitTests/UnitTests.Entities/PlayerEntity.cs @@ -35,7 +35,9 @@ public void TearDown() [Test] public void PlayerEntity_IsCreatedInTheWorld() { - Entity playerEntity = new PlayerEntityFactory(new InputMovableComponent(), + Entity playerEntity = new PlayerEntityFactory( + new NameComponent("Player"), + new InputMovableComponent(), new MovableComponent(), new TransformComponent(), new CameraComponent(), @@ -55,7 +57,9 @@ public void PlayerEntity_IsCreatedInTheWorld() [Test] public void PlayerEntity_HasComponents() { - Entity playerEntity = new PlayerEntityFactory(new InputMovableComponent(), + Entity playerEntity = new PlayerEntityFactory( + new NameComponent("Player"), + new InputMovableComponent(), new MovableComponent(), new TransformComponent(), new CameraComponent(), @@ -82,12 +86,14 @@ public void WorldSystemAndEntityWorkTogether() mockInputScanner.Setup(p => p.GetDirection()).Returns(Vector2.One); var rootFeature = new RootFeature(_world, - new WorldInitializer(_world, new WorldEntityFactory(new WorldComponent()), - new PlayerEntityFactory(new InputMovableComponent(), new MovableComponent(), new TransformComponent(), - new CameraComponent(new Viewport(0, 0, 640, 480)), new RectangleCollisionComponent(), - new InventoryComponent()), - new DummyEntityFactory(new TransformComponent(), new RectangleCollisionComponent()), - new RockEntityFactory(new ItemComponent(ItemId.Rock), new TransformComponent())), + new WorldInitializer(_world, new WorldEntityFactory(new WorldMetaComponent()), + new PlayerEntityFactory( + new NameComponent("Player"), new InputMovableComponent(), new MovableComponent(), + new TransformComponent(), new CameraComponent(new Viewport(0, 0, 640, 480)), + new RectangleCollisionComponent(), new InventoryComponent()), + new DummyEntityFactory(new NameComponent("Dummy"), new TransformComponent(), + new RectangleCollisionComponent()), + new RockEntityFactory(new NameComponent("Rock"), new ItemComponent(ItemId.Rock), new TransformComponent())), new MovementFeature(_world, new InputSystem(_world, mockInputScanner.Object), new MovementSystem(_world, new SimpleMovement())));