-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
532 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Libs/Components/Render/Animation/MovementAnimationsComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Components.Data; | ||
using LightInject; | ||
|
||
namespace CompositionRoots.Components.Data; | ||
|
||
public class ItemModule : ICompositionRoot | ||
{ | ||
public void Compose(IServiceRegistry serviceRegistry) | ||
{ | ||
serviceRegistry.RegisterSingleton(_ => new ItemComponent(ItemId.Rock), ItemsTable.Items[ItemId.Rock].Name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Components.Data; | ||
using LightInject; | ||
|
||
namespace CompositionRoots.Components.Data; | ||
|
||
public class NameModule : ICompositionRoot | ||
{ | ||
public void Compose(IServiceRegistry serviceRegistry) | ||
{ | ||
serviceRegistry.Register<string, NameComponent>((_, name) => new NameComponent(name)); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Libs/CompositionRoots/Components/Data/TransformModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Components.Data; | ||
using CompositionRoots.Components.Data; | ||
using LightInject; | ||
|
||
[assembly: CompositionRootType(typeof(TransformModule))] | ||
|
||
namespace CompositionRoots.Components.Data; | ||
|
||
public class TransformModule : ICompositionRoot | ||
{ | ||
public void Compose(IServiceRegistry serviceRegistry) | ||
{ | ||
serviceRegistry.RegisterTransient(_ => new TransformComponent()); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Components.Data; | ||
using Constants; | ||
using LightInject; | ||
using Microsoft.Xna.Framework.Graphics; | ||
|
||
namespace CompositionRoots.Entities; | ||
|
||
public class CameraModule : ICompositionRoot | ||
{ | ||
public void Compose(IServiceRegistry serviceRegistry) | ||
{ | ||
serviceRegistry.RegisterSingleton(_ => new Viewport(0, 0, 801, 480), DINames.Camera); | ||
serviceRegistry.RegisterSingleton(factory => | ||
new CameraComponent(factory.GetInstance<Viewport>(DINames.Camera))); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Libs/CompositionRoots/Entities/EntityFactoriesCompositionRoot.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using CompositionRoots.Entities; | ||
using Entities.Factories; | ||
using Entities.Factories.Items.Rocks; | ||
using Entities.Factories.Items.Trees; | ||
using LightInject; | ||
|
||
[assembly: CompositionRootType(typeof(EntityFactoriesCompositionRoot))] | ||
|
||
namespace CompositionRoots.Entities; | ||
|
||
public class EntityFactoriesCompositionRoot : ICompositionRoot | ||
{ | ||
public void Compose(IServiceRegistry serviceRegistry) | ||
{ | ||
serviceRegistry.RegisterFrom<WorldModule>(); | ||
serviceRegistry.RegisterFrom<PlayerModule>(); | ||
|
||
serviceRegistry.RegisterSingleton<TreeFactory>(); | ||
serviceRegistry.RegisterSingleton<AbstractTreeFactory>(); | ||
|
||
serviceRegistry.RegisterSingleton<PebbleFactory>(); | ||
serviceRegistry.RegisterSingleton<AbstractRockFactory>(); | ||
|
||
serviceRegistry.RegisterSingleton<EntitiesFactory>(); | ||
} | ||
} |
Oops, something went wrong.