-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
And simple setup for basic game class woot
- Loading branch information
Software Antics
committed
Apr 21, 2024
1 parent
883c6bf
commit 7150015
Showing
86 changed files
with
516 additions
and
2,345 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// <copyright file="ServiceCollectionExtensions.cs" company="Software Antics"> | ||
// Copyright (c) Software Antics. All rights reserved. | ||
// </copyright> | ||
|
||
namespace FinalEngine.ECS.Extensions; | ||
|
||
using System; | ||
using FinalEngine.ECS.Resolving; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
public static class ServiceCollectionExtensions | ||
{ | ||
public static IServiceCollection AddECS(this IServiceCollection services) | ||
{ | ||
ArgumentNullException.ThrowIfNull(services, nameof(services)); | ||
|
||
services.AddTransient<IEntityWorld, EntityWorld>(); | ||
services.AddSingleton<IEntitySystemResolver, EntitySystemResolver>(); | ||
|
||
return services; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// <copyright file="EntitySystemResolver.cs" company="Software Antics"> | ||
// Copyright (c) Software Antics. All rights reserved. | ||
// </copyright> | ||
|
||
namespace FinalEngine.ECS.Resolving; | ||
|
||
using System; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
internal sealed class EntitySystemResolver : IEntitySystemResolver | ||
{ | ||
private readonly IServiceProvider serviceProvider; | ||
|
||
public EntitySystemResolver(IServiceProvider serviceProvider) | ||
{ | ||
this.serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); | ||
} | ||
|
||
public TSystem GetEntitySystem<TSystem>() | ||
where TSystem : EntitySystemBase | ||
{ | ||
return this.serviceProvider.GetRequiredService<TSystem>(); | ||
} | ||
} |
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,11 @@ | ||
// <copyright file="IEntitySystemResolver.cs" company="Software Antics"> | ||
// Copyright (c) Software Antics. All rights reserved. | ||
// </copyright> | ||
|
||
namespace FinalEngine.ECS.Resolving; | ||
|
||
internal interface IEntitySystemResolver | ||
{ | ||
TSystem GetEntitySystem<TSystem>() | ||
where TSystem : EntitySystemBase; | ||
} |
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
145 changes: 0 additions & 145 deletions
145
FinalEngine.Editor.Common/Services/Scenes/Cameras/EditorCamera.cs
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
12 changes: 0 additions & 12 deletions
12
FinalEngine.Editor.Common/Services/Scenes/ISceneViewRenderer.cs
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
Oops, something went wrong.