-
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
1 parent
efb3326
commit e8cf056
Showing
44 changed files
with
469 additions
and
63 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
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
17 changes: 17 additions & 0 deletions
17
Assets/SRC/GameView/UseCases/Loaders/AvatarViewLoaderUseCase.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,17 @@ | ||
using MythosAndHorrors.GameRules; | ||
using Zenject; | ||
|
||
namespace MythosAndHorrors.GameView | ||
{ | ||
public class AvatarViewLoaderUseCase | ||
{ | ||
[Inject] private readonly AvatarViewsManager _avatarViewsManager; | ||
[Inject] private readonly InvestigatorsProvider _investigatorsProvider; | ||
|
||
/*******************************************************************/ | ||
public void Execute() | ||
{ | ||
_investigatorsProvider.AllInvestigators.ForEach(investigator => _avatarViewsManager.GetVoid().Init(investigator)); | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...seCases/Loaders/ZoneLoaderUseCase.cs.meta → ...s/Loaders/AvatarViewLoaderUseCase.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
8 changes: 3 additions & 5 deletions
8
...iew/UseCases/Loaders/ZoneLoaderUseCase.cs → ...UseCases/Loaders/ZoneViewLoaderUseCase.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
11 changes: 11 additions & 0 deletions
11
Assets/SRC/GameView/UseCases/Loaders/ZoneViewLoaderUseCase.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,17 @@ | ||
using Zenject; | ||
|
||
namespace MythosAndHorrors.GameView | ||
{ | ||
public class PrepareAllUseCase | ||
{ | ||
[Inject] private readonly PrepareGameRulesUseCase _loadGameRulesUseCase; | ||
[Inject] private readonly PrepareGameViewUseCase _loadGameViewUseCase; | ||
|
||
/*******************************************************************/ | ||
public void Execute() | ||
{ | ||
_loadGameRulesUseCase.Execute(); | ||
_loadGameViewUseCase.Execute(); | ||
} | ||
} | ||
} |
File renamed without changes.
13 changes: 3 additions & 10 deletions
13
...C/GameView/UseCases/PrepareGameUseCase.cs → ...eView/UseCases/PrepareGameRulesUseCase.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 |
---|---|---|
@@ -1,28 +1,21 @@ | ||
using Zenject; | ||
using Zenject; | ||
|
||
namespace MythosAndHorrors.GameView | ||
{ | ||
public class PrepareGameUseCase | ||
public class PrepareGameRulesUseCase | ||
{ | ||
[Inject] private readonly DataSaveUseCase _dataSaveLoaderUseCase; | ||
[Inject] private readonly TextsLoaderUseCase _textsLoaderUseCase; | ||
[Inject] private readonly InvestigatorLoaderUseCase _investigatorLoaderUseCase; | ||
[Inject] private readonly ChapterInfoLoaderUseCase _chapterInfoLoaderUseCase; | ||
[Inject] private readonly SceneLoaderUseCase _sceneLoaderUseCase; | ||
[Inject] private readonly ZoneLoaderUseCase _zoneLoaderUseCase; | ||
[Inject] private readonly CardViewGeneratorComponent _cardGeneratorComponent; | ||
[Inject] private readonly InvestigatorLoaderUseCase _investigatorLoaderUseCase; | ||
|
||
/*******************************************************************/ | ||
public void Execute() | ||
{ | ||
_dataSaveLoaderUseCase.Load(); | ||
_textsLoaderUseCase.LoadGameTexts(); | ||
_textsLoaderUseCase.LoadViewTexts(); | ||
_investigatorLoaderUseCase.Execute(); | ||
_chapterInfoLoaderUseCase.Execute(); | ||
_sceneLoaderUseCase.Execute(); | ||
_zoneLoaderUseCase.Execute(); | ||
_cardGeneratorComponent.BuildAllCardViews(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/SRC/GameView/UseCases/PrepareGameRulesUseCase.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,22 @@ | ||
using Zenject; | ||
|
||
namespace MythosAndHorrors.GameView | ||
{ | ||
public class PrepareGameViewUseCase | ||
{ | ||
[Inject] private readonly TextsLoaderUseCase _textsLoaderUseCase; | ||
[Inject] private readonly AvatarViewLoaderUseCase _avatarLoaderUseCase; | ||
[Inject] private readonly ZoneViewLoaderUseCase _zoneLoaderUseCase; | ||
[Inject] private readonly CardViewGeneratorComponent _cardGeneratorComponent; | ||
|
||
/*******************************************************************/ | ||
public void Execute() | ||
{ | ||
_textsLoaderUseCase.LoadGameTexts(); | ||
_textsLoaderUseCase.LoadViewTexts(); | ||
_avatarLoaderUseCase.Execute(); | ||
_zoneLoaderUseCase.Execute(); | ||
_cardGeneratorComponent.BuildAllCardViews(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/SRC/GameView/UseCases/PrepareGameViewUseCase.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
41 changes: 41 additions & 0 deletions
41
Assets/SRC/Tests.EditMode/Injection/InjectionServiceToTest.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,41 @@ | ||
using MythosAndHorrors.GameRules; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using Zenject; | ||
|
||
namespace MythosAndHorrors.EditMode.Tests | ||
{ | ||
public class InjectionServiceToTest : Installer | ||
{ | ||
public override void InstallBindings() | ||
{ | ||
//Container.Bind<PrepareGameToTest>().AsSingle(); | ||
BindAllFakePresenters(); | ||
} | ||
|
||
private void BindAllFakePresenters() | ||
{ | ||
IEnumerable<Type> gameActionTypes = typeof(GameAction).Assembly.GetTypes() | ||
.Where(type => type.IsClass && type.BaseType == typeof(GameAction)); | ||
|
||
foreach (Type type in gameActionTypes) | ||
{ | ||
BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance; | ||
FieldInfo[] campos = type.GetFields(flags); | ||
|
||
foreach (FieldInfo campo in campos) | ||
{ | ||
if (campo.FieldType.IsGenericType && | ||
campo.FieldType.GetGenericTypeDefinition() == typeof(IPresenter<>) && campo.FieldType.GetGenericArguments()[0] == type) | ||
{ | ||
Type genericToBind = typeof(FakeMoveCardsGamePresenter<>).MakeGenericType(type); | ||
Container.Unbind(campo.FieldType); | ||
Container.Bind(campo.FieldType).To(genericToBind).AsCached(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.