diff --git a/Assets/App/Scenes/SampleScene.unity b/Assets/App/Scenes/SampleScene.unity index 54f199e..8863f08 100644 --- a/Assets/App/Scenes/SampleScene.unity +++ b/Assets/App/Scenes/SampleScene.unity @@ -167,6 +167,127 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &325263820 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 325263821} + - component: {fileID: 325263824} + - component: {fileID: 325263823} + - component: {fileID: 325263822} + m_Layer: 5 + m_Name: UseSkillButton1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &325263821 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 325263820} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 698169214} + m_Father: {fileID: 568042970} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -200.00014, y: 21.100006} + m_SizeDelta: {x: 160, y: 30.5} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &325263822 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 325263820} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 325263823} + m_OnClick: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &325263823 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 325263820} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &325263824 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 325263820} + m_CullTransparentMesh: 1 --- !u!1 &404842156 GameObject: m_ObjectHideFlags: 0 @@ -712,6 +833,7 @@ RectTransform: - {fileID: 416316748} - {fileID: 1110636000} - {fileID: 1387411688} + - {fileID: 325263821} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -880,6 +1002,85 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 679057382} m_CullTransparentMesh: 1 +--- !u!1 &698169213 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 698169214} + - component: {fileID: 698169216} + - component: {fileID: 698169215} + m_Layer: 5 + m_Name: Text (Legacy) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &698169214 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 698169213} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 325263821} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &698169215 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 698169213} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: UseSkillButton1 +--- !u!222 &698169216 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 698169213} + m_CullTransparentMesh: 1 --- !u!1 &752973991 GameObject: m_ObjectHideFlags: 0 @@ -1009,6 +1210,7 @@ MonoBehaviour: autoInjectGameObjects: [] _BattleDebugEnemyPresenter: {fileID: 2048206442} _BattleDebugStatePresenter: {fileID: 2048206443} + _BattleDebugUseSkillPresenter: {fileID: 2048206444} --- !u!1 &842995928 GameObject: m_ObjectHideFlags: 0 @@ -1589,6 +1791,7 @@ GameObject: - component: {fileID: 2048206441} - component: {fileID: 2048206442} - component: {fileID: 2048206443} + - component: {fileID: 2048206444} m_Layer: 0 m_Name: BattleDebugPresenter m_TagString: Untagged @@ -1640,6 +1843,19 @@ MonoBehaviour: _cancelStateButton: {fileID: 416316749} _increaseStateIndexButton: {fileID: 1110636001} _decreaseStateIndexButton: {fileID: 1387411689} +--- !u!114 &2048206444 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2048206440} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 979a495aad96c2b498f91a66d2031d79, type: 3} + m_Name: + m_EditorClassIdentifier: + _useSkillButton1: {fileID: 325263822} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Assets/App/Scripts/Battle/BattleLifetimeScope.cs b/Assets/App/Scripts/Battle/BattleLifetimeScope.cs index 3f60f95..fbbcb7d 100644 --- a/Assets/App/Scripts/Battle/BattleLifetimeScope.cs +++ b/Assets/App/Scripts/Battle/BattleLifetimeScope.cs @@ -6,6 +6,7 @@ using UnityEngine; using VContainer; using VContainer.Unity; +using App.Common.Data.MasterData; public class BattleLifetimeScope : LifetimeScope { @@ -15,5 +16,8 @@ protected override void Configure(IContainerBuilder builder) builder.Register(Lifetime.Singleton).AsImplementedInterfaces(); builder.Register(Lifetime.Singleton).AsImplementedInterfaces(); builder.Register(Lifetime.Singleton).AsImplementedInterfaces(); + builder.Register(Lifetime.Singleton).AsImplementedInterfaces(); + builder.Register(Lifetime.Singleton).AsImplementedInterfaces(); + } } diff --git a/Assets/App/Scripts/Battle/Datastores/BattleSkillDatastore.cs b/Assets/App/Scripts/Battle/Datastores/BattleSkillDatastore.cs new file mode 100644 index 0000000..ca2423d --- /dev/null +++ b/Assets/App/Scripts/Battle/Datastores/BattleSkillDatastore.cs @@ -0,0 +1,43 @@ +using App.Battle.Data; +using App.Common.Data; +using App.Battle.Interfaces.Datastores; +using System; +using System.Linq; +using System.Collections.Generic; +using UniRx; + +namespace App.Battle.Datastores +{ + public class BattleSkillDatastore : IBattleEnemyDatastore, IDisposable + { + private Dictionary _enemies = new(); + public IEnumerable Enemies => _enemies.Values.ToArray(); + + + public void RemoveEnemy(string id) + { + if(!_enemies.ContainsKey(id)) + { + return; + } + _enemies.Remove(id); + } + + public Enemy GetEnemyBy(string id) + { + if(!_enemies.ContainsKey(id)) + { + return null; + } + + var enemy = _enemies[id]; + UnityEngine.Debug.Log($"{enemy} got"); + return enemy; + } + + public void Dispose() + { + _enemies.Clear(); + } + } +} \ No newline at end of file diff --git a/Assets/App/Scripts/Battle/Datastores/BattleSkillDatastore.cs.meta b/Assets/App/Scripts/Battle/Datastores/BattleSkillDatastore.cs.meta new file mode 100644 index 0000000..43b4cce --- /dev/null +++ b/Assets/App/Scripts/Battle/Datastores/BattleSkillDatastore.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1a56bf897881cc94dbd924ddc2c0dba3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/App/Scripts/Battle/Interfaces/Presenters/IUseSkillPresenter.cs b/Assets/App/Scripts/Battle/Interfaces/Presenters/IBattleUseSkillPresenter.cs similarity index 63% rename from Assets/App/Scripts/Battle/Interfaces/Presenters/IUseSkillPresenter.cs rename to Assets/App/Scripts/Battle/Interfaces/Presenters/IBattleUseSkillPresenter.cs index 89f4f24..3c6c30d 100644 --- a/Assets/App/Scripts/Battle/Interfaces/Presenters/IUseSkillPresenter.cs +++ b/Assets/App/Scripts/Battle/Interfaces/Presenters/IBattleUseSkillPresenter.cs @@ -1,10 +1,11 @@ +using App.Battle.Data; using App.Common.Data; using App.Common.Data.MasterData; namespace App.Battle.Interfaces.Presenters { - public interface IUseSkillPresenter + public interface IBattleUseSkillPresenter { - HealthPoint CalculateDamage(CharacterParameter player, BattleSkillData skill, EnemyMasterData enemy); + HealthPoint CalculateDamage(CharacterParameter player, BattleSkillData skill, Enemy enemy); } } \ No newline at end of file diff --git a/Assets/App/Scripts/Battle/Interfaces/Presenters/IUseSkillPresenter.cs.meta b/Assets/App/Scripts/Battle/Interfaces/Presenters/IBattleUseSkillPresenter.cs.meta similarity index 100% rename from Assets/App/Scripts/Battle/Interfaces/Presenters/IUseSkillPresenter.cs.meta rename to Assets/App/Scripts/Battle/Interfaces/Presenters/IBattleUseSkillPresenter.cs.meta diff --git a/Assets/App/Scripts/Battle/Interfaces/UseCases/IUseSkillUseCase.cs b/Assets/App/Scripts/Battle/Interfaces/UseCases/IBattleUseSkillUseCase.cs similarity index 82% rename from Assets/App/Scripts/Battle/Interfaces/UseCases/IUseSkillUseCase.cs rename to Assets/App/Scripts/Battle/Interfaces/UseCases/IBattleUseSkillUseCase.cs index 0b72fbe..1dd8514 100644 --- a/Assets/App/Scripts/Battle/Interfaces/UseCases/IUseSkillUseCase.cs +++ b/Assets/App/Scripts/Battle/Interfaces/UseCases/IBattleUseSkillUseCase.cs @@ -4,7 +4,7 @@ namespace App.Battle.Interfaces.UseCases { - public interface IUseSkillUseCase + public interface IBattleUseSkillUseCase { void UseSkill(CharacterParameter player, int skillId, int enemyId); } diff --git a/Assets/App/Scripts/Battle/Interfaces/UseCases/IUseSkillUseCase.cs.meta b/Assets/App/Scripts/Battle/Interfaces/UseCases/IBattleUseSkillUseCase.cs.meta similarity index 100% rename from Assets/App/Scripts/Battle/Interfaces/UseCases/IUseSkillUseCase.cs.meta rename to Assets/App/Scripts/Battle/Interfaces/UseCases/IBattleUseSkillUseCase.cs.meta diff --git a/Assets/App/Scripts/Battle/Presenters/BattleUseSkillPresenter.cs b/Assets/App/Scripts/Battle/Presenters/BattleUseSkillPresenter.cs index 527c03b..0927c29 100644 --- a/Assets/App/Scripts/Battle/Presenters/BattleUseSkillPresenter.cs +++ b/Assets/App/Scripts/Battle/Presenters/BattleUseSkillPresenter.cs @@ -1,15 +1,16 @@ using App.Common.Data.MasterData; using App.Common.Data; using App.Battle.Interfaces.Presenters; +using App.Battle.Data; namespace App.Battle.Presenters { - public class BattleUseSkillPresenter: IUseSkillPresenter + public class BattleUseSkillPresenter: IBattleUseSkillPresenter { - public HealthPoint CalculateDamage(CharacterParameter player, BattleSkillData skill, EnemyMasterData enemy) + public HealthPoint CalculateDamage(CharacterParameter player, BattleSkillData skill, Enemy enemy) { - HealthPoint damage = new HealthPoint(player.Atk.CurrentValue*skill.AtkRate - enemy.CharacterParameter.Def.CurrentValue); - HealthPoint matdamage = new HealthPoint(player.Mat.CurrentValue*skill.MatRate - enemy.CharacterParameter.Mde.CurrentValue); + HealthPoint damage = new HealthPoint(player.Atk.CurrentValue*skill.AtkRate - enemy.characterParameter.Def.CurrentValue); + HealthPoint matdamage = new HealthPoint(player.Mat.CurrentValue*skill.MatRate - enemy.characterParameter.Mde.CurrentValue); damage = damage.AddCurrentValue(matdamage); diff --git a/Assets/App/Scripts/Battle/UseCases/BattleUseSkillUseCase.cs b/Assets/App/Scripts/Battle/UseCases/BattleUseSkillUseCase.cs index 4b9c18a..d350904 100644 --- a/Assets/App/Scripts/Battle/UseCases/BattleUseSkillUseCase.cs +++ b/Assets/App/Scripts/Battle/UseCases/BattleUseSkillUseCase.cs @@ -1,25 +1,25 @@ -using App.Common.Data.MasterData; using App.Common.Data; using App.Battle.Presenters; using App.Battle.Interfaces.UseCases; +using App.Battle.Interfaces.Datastores; namespace App.Battle.UseCases { - public class BattleUseSkillUseCase: IUseSkillUseCase + public class BattleUseSkillUseCase : IBattleUseSkillUseCase { - private readonly BattleSkillDataBase _battleSkillDataBase; - private readonly EnemyMasterDataBase _enemyMasterDataBase; + private readonly IBattleSkillDataBase _battleSkillDataBase; + private readonly IBattleEnemyDatastore _battleEnemyDatastore; - public BattleUseSkillUseCase(BattleSkillDataBase battleSkillDataBase, EnemyMasterDataBase enemyMasterDataBase) + public BattleUseSkillUseCase(IBattleSkillDataBase battleSkillDataBase, IBattleEnemyDatastore battleEnemyDatastore) { _battleSkillDataBase = battleSkillDataBase; - _enemyMasterDataBase = enemyMasterDataBase; + _battleEnemyDatastore = battleEnemyDatastore; } public void UseSkill(CharacterParameter player, int skillId, int enemyId) { - var skill = _battleSkillDataBase.BattleSkillData[skillId]; - var enemy = _enemyMasterDataBase.EnemyMasterData[enemyId]; + var skill = _battleSkillDataBase.[skillId]; + var enemy = _battleEnemyDatastore.GetEnemyBy($"{enemyId}"); if (player.Mp.CurrentValue < skill.ConsumeMp) return; @@ -27,8 +27,9 @@ public void UseSkill(CharacterParameter player, int skillId, int enemyId) HealthPoint damage = useSkillPresenter.CalculateDamage(player, skill, enemy); MagicPoint consumeMp = new MagicPoint(skill.ConsumeMp); - enemy.CharacterParameter.Hp = enemy.CharacterParameter.Hp.SubtractCurrentValue(damage); + enemy.characterParameter.Hp = enemy.characterParameter.Hp.SubtractCurrentValue(damage); player.Mp = player.Mp.SubtractCurrentValue(consumeMp); + UnityEngine.Debug.Log($"{player.Name}は{enemy.characterParameter.Name}に{damage.CurrentValue}のダメージを与えた"); } } } \ No newline at end of file diff --git a/Assets/App/Scripts/Debug/Battle/BattleDebugLifetimeScope.cs b/Assets/App/Scripts/Debug/Battle/BattleDebugLifetimeScope.cs index 93f85cb..40e21a0 100644 --- a/Assets/App/Scripts/Debug/Battle/BattleDebugLifetimeScope.cs +++ b/Assets/App/Scripts/Debug/Battle/BattleDebugLifetimeScope.cs @@ -10,6 +10,7 @@ public class BattleDebugLifetimeScope : LifetimeScope { [SerializeField] private BattleDebugEnemyPresenter _BattleDebugEnemyPresenter; [SerializeField] private BattleDebugStatePresenter _BattleDebugStatePresenter; + [SerializeField] private BattleDebugUseSkillPresenter _BattleDebugUseSkillPresenter; protected override void Configure(IContainerBuilder builder) { @@ -17,6 +18,8 @@ protected override void Configure(IContainerBuilder builder) builder.RegisterEntryPoint(); builder.RegisterComponent(_BattleDebugStatePresenter).AsImplementedInterfaces(); builder.RegisterEntryPoint(); + builder.RegisterComponent(_BattleDebugUseSkillPresenter).AsImplementedInterfaces(); + builder.RegisterEntryPoint(); } } } diff --git a/Assets/App/Scripts/Debug/Battle/Interfaces/Presenters/IBattleDebugUseSkillPresenter.cs b/Assets/App/Scripts/Debug/Battle/Interfaces/Presenters/IBattleDebugUseSkillPresenter.cs new file mode 100644 index 0000000..6add960 --- /dev/null +++ b/Assets/App/Scripts/Debug/Battle/Interfaces/Presenters/IBattleDebugUseSkillPresenter.cs @@ -0,0 +1,10 @@ +using System; +using UniRx; + +namespace App.Debug.Battle.Interfaces.Presenters +{ + public interface IBattleDebugUseSkillPresenter + { + IObservable OnUseSkill1 { get; } + } +} diff --git a/Assets/App/Scripts/Debug/Battle/Interfaces/Presenters/IBattleDebugUseSkillPresenter.cs.meta b/Assets/App/Scripts/Debug/Battle/Interfaces/Presenters/IBattleDebugUseSkillPresenter.cs.meta new file mode 100644 index 0000000..8a8e20e --- /dev/null +++ b/Assets/App/Scripts/Debug/Battle/Interfaces/Presenters/IBattleDebugUseSkillPresenter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e42e4e24ace239042a3a6310a82acf7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/App/Scripts/Debug/Battle/Presenters/BattleDebugUseSkillPresenter.cs b/Assets/App/Scripts/Debug/Battle/Presenters/BattleDebugUseSkillPresenter.cs new file mode 100644 index 0000000..3ab4b9c --- /dev/null +++ b/Assets/App/Scripts/Debug/Battle/Presenters/BattleDebugUseSkillPresenter.cs @@ -0,0 +1,32 @@ +using App.Debug.Battle.Interfaces.Presenters; +using System; +using UniRx; +using UnityEngine; +using UnityEngine.UI; +using VContainer.Unity; + +namespace App.Debug.Battle.Presenters +{ + public class BattleDebugUseSkillPresenter : MonoBehaviour, IBattleDebugUseSkillPresenter, IInitializable, IDisposable + { + [Header("Skill")] + [SerializeField] private Button _useSkillButton1; + + private readonly Subject _onUseSkill1 = new(); + public IObservable OnUseSkill1 => _onUseSkill1; + + private readonly CompositeDisposable _disposables = new(); + public void Initialize() + { + _useSkillButton1.OnClickAsObservable() + .Subscribe(_ => _onUseSkill1.OnNext(Unit.Default)) + .AddTo(_disposables); + UnityEngine.Debug.Log("BattleDebugUseSkillPresenter Initialized"); + } + + public void Dispose() + { + _disposables.Dispose(); + } + } +} diff --git a/Assets/App/Scripts/Debug/Battle/Presenters/BattleDebugUseSkillPresenter.cs.meta b/Assets/App/Scripts/Debug/Battle/Presenters/BattleDebugUseSkillPresenter.cs.meta new file mode 100644 index 0000000..0df7eab --- /dev/null +++ b/Assets/App/Scripts/Debug/Battle/Presenters/BattleDebugUseSkillPresenter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 979a495aad96c2b498f91a66d2031d79 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/App/Scripts/Debug/Battle/UseCases/BattleDebugUseSkillUseCase.cs b/Assets/App/Scripts/Debug/Battle/UseCases/BattleDebugUseSkillUseCase.cs new file mode 100644 index 0000000..5cf467f --- /dev/null +++ b/Assets/App/Scripts/Debug/Battle/UseCases/BattleDebugUseSkillUseCase.cs @@ -0,0 +1,42 @@ +using App.Battle.Interfaces.UseCases; +using App.Debug.Battle.Interfaces.Presenters; +using App.Common.Data; +using System; +using UniRx; +using VContainer; +using VContainer.Unity; + +namespace App.Debug.Battle.UseCases +{ + public class BattleDebugUseSkillUseCase : IInitializable, IDisposable + { + private readonly IBattleDebugUseSkillPresenter _BattleDebugUseSkillPresenter; + private readonly IBattleUseSkillUseCase _BattleUseSkillUseCase; + + private readonly CharacterParameter testPlayer = new CharacterParameter(); + + private readonly CompositeDisposable _disposables = new(); + + [Inject] + public BattleDebugUseSkillUseCase( + IBattleUseSkillUseCase battleUseSkillUseCase, + IBattleDebugUseSkillPresenter battleDebugUseSkillPresenter + ) + { + _BattleUseSkillUseCase = battleUseSkillUseCase; + _BattleDebugUseSkillPresenter = battleDebugUseSkillPresenter; + } + + public void Initialize() + { + _BattleDebugUseSkillPresenter.OnUseSkill1 + .Subscribe(x => _BattleUseSkillUseCase.UseSkill(testPlayer, 1, 1)) + .AddTo(_disposables); + } + + public void Dispose() + { + _disposables.Dispose(); + } + } +} diff --git a/Assets/App/Scripts/Debug/Battle/UseCases/BattleDebugUseSkillUseCase.cs.meta b/Assets/App/Scripts/Debug/Battle/UseCases/BattleDebugUseSkillUseCase.cs.meta new file mode 100644 index 0000000..4b80c44 --- /dev/null +++ b/Assets/App/Scripts/Debug/Battle/UseCases/BattleDebugUseSkillUseCase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2680f29c3b20294488f12417eacb6579 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: