[add] 1차 검수
This commit is contained in:
@@ -236,21 +236,13 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Player.h" />
|
||||
<ClInclude Include="..\public\Slot_Number.h" />
|
||||
<ClInclude Include="..\Public\State_Cast.h" />
|
||||
<ClInclude Include="..\Public\State_Combat.h" />
|
||||
<ClInclude Include="..\Public\State_Dodge.h" />
|
||||
<ClInclude Include="..\Public\State_Idle.h" />
|
||||
<ClInclude Include="..\Public\State_Idle_Turn.h" />
|
||||
<ClInclude Include="..\Public\State_Jog.h" />
|
||||
<ClInclude Include="..\Public\State_Jump.h" />
|
||||
<ClInclude Include="..\Public\State_Land.h" />
|
||||
<ClInclude Include="..\Public\State_LightAttack.h" />
|
||||
<ClInclude Include="..\Public\State_Move.h" />
|
||||
<ClInclude Include="..\Public\State_Root.h" />
|
||||
<ClInclude Include="..\Public\State_Skill.h" />
|
||||
<ClInclude Include="..\Public\State_Skill2.h" />
|
||||
<ClInclude Include="..\Public\State_Sprint.h" />
|
||||
<ClInclude Include="..\Public\State_Walk.h" />
|
||||
<ClInclude Include="..\Public\State_Player_Combat.h" />
|
||||
<ClInclude Include="..\Public\State_Player_Dodge.h" />
|
||||
<ClInclude Include="..\Public\State_Player_Idle.h" />
|
||||
<ClInclude Include="..\Public\State_Player_Jump.h" />
|
||||
<ClInclude Include="..\Public\State_Player_Land.h" />
|
||||
<ClInclude Include="..\Public\State_Player_Move.h" />
|
||||
<ClInclude Include="..\Public\State_Player.h" />
|
||||
<ClInclude Include="..\public\Spell_Image.h" />
|
||||
<ClInclude Include="..\public\Spell_Overlay.h" />
|
||||
<ClInclude Include="..\public\Spell_Slot.h" />
|
||||
@@ -368,21 +360,13 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Player.cpp" />
|
||||
<ClCompile Include="..\private\Slot_Number.cpp" />
|
||||
<ClCompile Include="..\Private\State_Cast.cpp" />
|
||||
<ClCompile Include="..\Private\State_Combat.cpp" />
|
||||
<ClCompile Include="..\Private\State_Dodge.cpp" />
|
||||
<ClCompile Include="..\Private\State_Idle.cpp" />
|
||||
<ClCompile Include="..\Private\State_Idle_Turn.cpp" />
|
||||
<ClCompile Include="..\Private\State_Jog.cpp" />
|
||||
<ClCompile Include="..\Private\State_Jump.cpp" />
|
||||
<ClCompile Include="..\Private\State_Land.cpp" />
|
||||
<ClCompile Include="..\Private\State_LightAttack.cpp" />
|
||||
<ClCompile Include="..\Private\State_Move.cpp" />
|
||||
<ClCompile Include="..\Private\State_Root.cpp" />
|
||||
<ClCompile Include="..\Private\State_Skill.cpp" />
|
||||
<ClCompile Include="..\Private\State_Skill2.cpp" />
|
||||
<ClCompile Include="..\Private\State_Sprint.cpp" />
|
||||
<ClCompile Include="..\Private\State_Walk.cpp" />
|
||||
<ClCompile Include="..\Private\State_Player_Combat.cpp" />
|
||||
<ClCompile Include="..\Private\State_Player_Dodge.cpp" />
|
||||
<ClCompile Include="..\Private\State_Player_Idle.cpp" />
|
||||
<ClCompile Include="..\Private\State_Player_Jump.cpp" />
|
||||
<ClCompile Include="..\Private\State_Player_Land.cpp" />
|
||||
<ClCompile Include="..\Private\State_Player_Move.cpp" />
|
||||
<ClCompile Include="..\Private\State_Player.cpp" />
|
||||
<ClCompile Include="..\private\Spell_Image.cpp" />
|
||||
<ClCompile Include="..\private\Spell_Overlay.cpp" />
|
||||
<ClCompile Include="..\private\Spell_Slot.cpp" />
|
||||
|
||||
@@ -223,12 +223,6 @@
|
||||
<Filter Include="80.State">
|
||||
<UniqueIdentifier>{9c21aba5-00c1-4b4c-8a82-dac7a156fd9b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Idle">
|
||||
<UniqueIdentifier>{d5681f71-af29-4418-bf3a-a1486c6ba171}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Jump">
|
||||
<UniqueIdentifier>{904a7ae5-33fe-49a1-9f31-27443acc9e1a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Player">
|
||||
<UniqueIdentifier>{680910fd-aee2-4f69-b644-12b36b0f635b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -274,36 +268,9 @@
|
||||
<Filter Include="02.GameObjects\Dummys\DummyGlobe">
|
||||
<UniqueIdentifier>{04d044a9-3cab-4425-9adf-8eea436e71d4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Land">
|
||||
<UniqueIdentifier>{0b8cac41-419f-48ce-87bc-805b8962b4df}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Monster\Goblin">
|
||||
<UniqueIdentifier>{26e2dcaa-d94a-4c3d-ba39-2916f2a27bac}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move">
|
||||
<UniqueIdentifier>{dac78c4e-b898-45dc-8740-794899de0c69}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Sprint">
|
||||
<UniqueIdentifier>{1cac1aa6-ea12-429e-8a84-ca2bf44c2be4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Walk">
|
||||
<UniqueIdentifier>{43bc0f97-0b7d-406b-900c-0fae023023ec}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat">
|
||||
<UniqueIdentifier>{a56502cb-b0b8-4ea7-bc5e-5482b416fef9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Cast">
|
||||
<UniqueIdentifier>{5f6e884b-3ab2-4354-b378-44e8221a4720}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_LightAttack">
|
||||
<UniqueIdentifier>{0aa8e406-d786-4e40-b825-54d5e3f691e2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Skill">
|
||||
<UniqueIdentifier>{eb7d24ee-d60e-4062-b974-264409436d81}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Dodge">
|
||||
<UniqueIdentifier>{b017e167-f48d-4417-a924-765ab802cff5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Layer_Effect\Effect\03.TrailObject">
|
||||
<UniqueIdentifier>{f5cd19e8-186b-418f-b7fa-af73046a80d1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -313,15 +280,6 @@
|
||||
<Filter Include="02.GameObjects\Layer_Effect\Effect\05.NomalJap">
|
||||
<UniqueIdentifier>{8882358e-c8eb-4222-a87e-01d902533b8f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Skill2">
|
||||
<UniqueIdentifier>{3614836d-9988-4ec0-95a8-f8ebc25a9a13}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Idle\State_Idle_Turn">
|
||||
<UniqueIdentifier>{98f012a4-2f13-456f-85ba-6929b1535de6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Jog">
|
||||
<UniqueIdentifier>{3ad2f4c4-95e6-47fa-9f4c-b9fcdbd77277}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Broom">
|
||||
<UniqueIdentifier>{a9862861-6eaa-4e04-b7f6-217a32db7db4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -355,6 +313,33 @@
|
||||
<Filter Include="02.GameObjects\Wand">
|
||||
<UniqueIdentifier>{92110a48-81d0-4e98-be06-05dd078d0488}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat">
|
||||
<UniqueIdentifier>{a56502cb-b0b8-4ea7-bc5e-5482b416fef9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Movement">
|
||||
<UniqueIdentifier>{8a70232d-f917-4ff6-b617-302e325996ae}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Movement\State_Move">
|
||||
<UniqueIdentifier>{dac78c4e-b898-45dc-8740-794899de0c69}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Movement\State_Idle">
|
||||
<UniqueIdentifier>{d5681f71-af29-4418-bf3a-a1486c6ba171}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Focus">
|
||||
<UniqueIdentifier>{029a22c4-ab06-4db0-9527-4e3cfa1a2e0d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Focus\State_Dodge">
|
||||
<UniqueIdentifier>{b017e167-f48d-4417-a924-765ab802cff5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Focus\State_Jump">
|
||||
<UniqueIdentifier>{904a7ae5-33fe-49a1-9f31-27443acc9e1a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Focus\State_Land">
|
||||
<UniqueIdentifier>{0b8cac41-419f-48ce-87bc-805b8962b4df}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Casting">
|
||||
<UniqueIdentifier>{c1e05cd0-4551-487b-8e47-4119db646c60}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Editor.h">
|
||||
@@ -564,20 +549,14 @@
|
||||
<ClInclude Include="..\Public\Dummy_PhysXWall.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXWall</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Dodge.h">
|
||||
<Filter>80.State\State_Combat\State_Dodge</Filter>
|
||||
<ClInclude Include="..\Public\State_Player_Dodge.h">
|
||||
<Filter>80.State\Focus\State_Dodge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Idle.h">
|
||||
<Filter>80.State\State_Idle</Filter>
|
||||
<ClInclude Include="..\Public\State_Player_Idle.h">
|
||||
<Filter>80.State\Movement\State_Idle</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Walk.h">
|
||||
<Filter>80.State\State_Move\State_Walk</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Sprint.h">
|
||||
<Filter>80.State\State_Move\State_Sprint</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Jump.h">
|
||||
<Filter>80.State\State_Jump</Filter>
|
||||
<ClInclude Include="..\Public\State_Player_Jump.h">
|
||||
<Filter>80.State\Focus\State_Jump</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Player.h">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
@@ -627,25 +606,16 @@
|
||||
<ClInclude Include="..\Public\Dummy_Globe.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyGlobe</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Skill.h">
|
||||
<Filter>80.State\State_Combat\State_Skill</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_LightAttack.h">
|
||||
<Filter>80.State\State_Combat\State_LightAttack</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Land.h">
|
||||
<Filter>80.State\State_Land</Filter>
|
||||
<ClInclude Include="..\Public\State_Player_Land.h">
|
||||
<Filter>80.State\Focus\State_Land</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Goblin.h">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Cast.h">
|
||||
<Filter>80.State\State_Combat\State_Cast</Filter>
|
||||
<ClInclude Include="..\Public\State_Player_Move.h">
|
||||
<Filter>80.State\Movement\State_Move</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Move.h">
|
||||
<Filter>80.State\State_Move</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Combat.h">
|
||||
<ClInclude Include="..\Public\State_Player_Combat.h">
|
||||
<Filter>80.State\State_Combat</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\TrailObject.h">
|
||||
@@ -657,15 +627,6 @@
|
||||
<ClInclude Include="..\Public\NomalJap.h">
|
||||
<Filter>02.GameObjects\Layer_Effect\Effect\05.NomalJap</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Skill2.h">
|
||||
<Filter>80.State\State_Combat\State_Skill2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Idle_Turn.h">
|
||||
<Filter>80.State\State_Idle\State_Idle_Turn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Jog.h">
|
||||
<Filter>80.State\State_Move\State_Jog</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Broom.h">
|
||||
<Filter>02.GameObjects\Broom</Filter>
|
||||
</ClInclude>
|
||||
@@ -696,12 +657,12 @@
|
||||
<ClInclude Include="..\Public\CamPosition_Arm.h">
|
||||
<Filter>02.GameObjects\Camera</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Root.h">
|
||||
<Filter>80.State</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Wand.h">
|
||||
<Filter>02.GameObjects\Wand</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Player.h">
|
||||
<Filter>80.State</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Editor.ico">
|
||||
@@ -916,23 +877,14 @@
|
||||
<ClCompile Include="..\Private\Dummy_PhysXDoorFrame.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXDoorFrame</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Dodge.cpp">
|
||||
<Filter>80.State\State_Combat\State_Dodge</Filter>
|
||||
<ClCompile Include="..\Private\State_Player_Dodge.cpp">
|
||||
<Filter>80.State\Focus\State_Dodge</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Idle.cpp">
|
||||
<Filter>80.State\State_Idle</Filter>
|
||||
<ClCompile Include="..\Private\State_Player_Idle.cpp">
|
||||
<Filter>80.State\Movement\State_Idle</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Walk.cpp">
|
||||
<Filter>80.State\State_Move\State_Walk</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Sprint.cpp">
|
||||
<Filter>80.State\State_Move\State_Sprint</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Jump.cpp">
|
||||
<Filter>80.State\State_Jump</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Player.cpp">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
<ClCompile Include="..\Private\State_Player_Jump.cpp">
|
||||
<Filter>80.State\Focus\State_Jump</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Land.cpp">
|
||||
<Filter>02.GameObjects\Env\04.Land</Filter>
|
||||
@@ -970,25 +922,16 @@
|
||||
<ClCompile Include="..\Private\Dummy_Globe.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyGlobe</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Skill.cpp">
|
||||
<Filter>80.State\State_Combat\State_Skill</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_LightAttack.cpp">
|
||||
<Filter>80.State\State_Combat\State_LightAttack</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Land.cpp">
|
||||
<Filter>80.State\State_Land</Filter>
|
||||
<ClCompile Include="..\Private\State_Player_Land.cpp">
|
||||
<Filter>80.State\Focus\State_Land</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin.cpp">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Cast.cpp">
|
||||
<Filter>80.State\State_Combat\State_Cast</Filter>
|
||||
<ClCompile Include="..\Private\State_Player_Move.cpp">
|
||||
<Filter>80.State\Movement\State_Move</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Move.cpp">
|
||||
<Filter>80.State\State_Move</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Combat.cpp">
|
||||
<ClCompile Include="..\Private\State_Player_Combat.cpp">
|
||||
<Filter>80.State\State_Combat</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\TrailObject.cpp">
|
||||
@@ -1000,15 +943,6 @@
|
||||
<ClCompile Include="..\Private\NomalJap.cpp">
|
||||
<Filter>02.GameObjects\Layer_Effect\Effect\05.NomalJap</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Skill2.cpp">
|
||||
<Filter>80.State\State_Combat\State_Skill2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Idle_Turn.cpp">
|
||||
<Filter>80.State\State_Idle\State_Idle_Turn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Jog.cpp">
|
||||
<Filter>80.State\State_Move\State_Jog</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Broom.cpp">
|
||||
<Filter>02.GameObjects\Broom</Filter>
|
||||
</ClCompile>
|
||||
@@ -1039,12 +973,15 @@
|
||||
<ClCompile Include="..\Private\CamPosition_Arm.cpp">
|
||||
<Filter>02.GameObjects\Camera</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Root.cpp">
|
||||
<Filter>80.State</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Wand.cpp">
|
||||
<Filter>02.GameObjects\Wand</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Player.cpp">
|
||||
<Filter>80.State</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Player.cpp">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc">
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "State_Idle.h"
|
||||
#include "State_Walk.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Sprint.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Skill.h"
|
||||
|
||||
CDummyObject::CDummyObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CUnit(pDevice, pContext)
|
||||
|
||||
@@ -8,22 +8,13 @@
|
||||
#include "Wand.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Root.h"
|
||||
|
||||
#include "State_Idle.h"
|
||||
#include "State_Walk.h"
|
||||
#include "State_Jog.h"
|
||||
#include "State_Sprint.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Skill.h"
|
||||
#include "State_Skill2.h"
|
||||
#include "State_LightAttack.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Cast.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#include "State_Idle_Turn.h"
|
||||
#include "State_Player_Idle.h"
|
||||
#include "State_Player_Dodge.h"
|
||||
#include "State_Player_Jump.h"
|
||||
#include "State_Player_Land.h"
|
||||
#include "State_Player_Move.h"
|
||||
#include "State_Player_Combat.h"
|
||||
#pragma endregion
|
||||
|
||||
CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
@@ -57,8 +48,6 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
|
||||
Add_FSM();
|
||||
|
||||
Set_FSM();
|
||||
|
||||
Set_Anim();
|
||||
|
||||
Setup_InputConditions();
|
||||
@@ -79,7 +68,7 @@ void CPlayer::Update(_float fTimeDelta)
|
||||
|
||||
Key_Input(fTimeDelta);
|
||||
|
||||
m_pFSM->Update(fTimeDelta);
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
|
||||
@@ -257,10 +246,7 @@ void CPlayer::Setup_InputConditions()
|
||||
|
||||
void CPlayer::Key_Input(_float fTimeDelta)
|
||||
{
|
||||
if (m_pFSM->Get_CurrState() == FSMSTATE::WALK ||
|
||||
m_pFSM->Get_CurrState() == FSMSTATE::SPRINT||
|
||||
m_pFSM->Get_CurrState() == FSMSTATE::DODGE||
|
||||
m_pFSM->Get_CurrState() == FSMSTATE::JOG)
|
||||
if (m_pFSM->IsEnable(FSMSTATE::WALK|FSMSTATE::SPRINT |FSMSTATE::DODGE |FSMSTATE::JOG))
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_LEFT))
|
||||
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
|
||||
@@ -276,56 +262,42 @@ void CPlayer::Key_Input(_float fTimeDelta)
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
{
|
||||
#pragma region MOVE
|
||||
m_pFSM->Add_State(FSMSTATE::MOVE, new CState_Move());
|
||||
m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle());
|
||||
m_pFSM->Add_State(FSMSTATE::IDLE_TURN, new CState_Idle_Turn());
|
||||
m_pFSM->Add_State(FSMSTATE::WALK, new CState_Walk());
|
||||
m_pFSM->Add_State(FSMSTATE::JOG, new CState_Jog());
|
||||
m_pFSM->Add_State(FSMSTATE::SPRINT, new CState_Sprint());
|
||||
m_pFSM->Add_State(FSMSTATE::DODGE, new CState_Dodge());
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Player_Idle::STATE_PLAYER_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Player_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Player_Move::STATE_PLAYER_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Player_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region COMBAT
|
||||
m_pFSM->Add_State(FSMSTATE::COMBAT, new CState_Combat());
|
||||
m_pFSM->Add_State(FSMSTATE::SKILL, new CState_Skill());
|
||||
m_pFSM->Add_State(FSMSTATE::SKILL2, new CState_Skill2());
|
||||
m_pFSM->Add_State(FSMSTATE::LIGHT_ATTACK, new CState_LightAttack());
|
||||
m_pFSM->Add_State(FSMSTATE::CAST, new CState_Cast());
|
||||
#pragma region Behavior_Movement_Focus
|
||||
{
|
||||
CState_Player_Jump::STATE_PLAYER_JUMP_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Player_Jump::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Player_Land::STATE_PLAYER_LAND_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Player_Land::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Player_Dodge::STATE_PLAYER_DODGE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Player_Dodge::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
|
||||
m_pFSM->Add_State(FSMSTATE::JUMP, new CState_Jump());
|
||||
m_pFSM->Add_State(FSMSTATE::LAND, new CState_Land());
|
||||
|
||||
m_pFSM->Add_State(FSMSTATE::ROOT, new CState_Root());
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::Set_FSM()
|
||||
{
|
||||
#pragma region ROOT
|
||||
m_pFSM->Set_Parent(FSMSTATE::MOVE, FSMSTATE::ROOT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::COMBAT, FSMSTATE::ROOT);
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region MOVE
|
||||
m_pFSM->Set_Parent(FSMSTATE::IDLE, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::IDLE_TURN, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::WALK, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::BWD, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::FWD, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::JOG, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::SPRINT, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::DODGE, FSMSTATE::MOVE);
|
||||
#pragma endregion
|
||||
|
||||
#pragma region COMBAT
|
||||
m_pFSM->Set_Parent(FSMSTATE::SKILL, FSMSTATE::COMBAT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::SKILL2, FSMSTATE::COMBAT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::LIGHT_ATTACK, FSMSTATE::COMBAT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::CAST, FSMSTATE::COMBAT);
|
||||
#pragma endregion
|
||||
}
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Cast.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Cast::CState_Cast()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Cast::Enter()
|
||||
{
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::CAST)
|
||||
return;
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Cast::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Cast::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Cast::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||
{
|
||||
_uint combo = m_pOwner->Next_LightCombo();
|
||||
m_pOwner->Set_LightCombo(combo);
|
||||
if (combo >= 3)
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
return true;
|
||||
}
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST);
|
||||
m_pModel->Set_AnimationIndex(anim.first + combo, anim.second);
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Cast::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Cast::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Combat.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Combat::CState_Combat()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Combat::Enter()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
|
||||
}
|
||||
|
||||
void CState_Combat::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Combat::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Combat::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->IsCurrentKeyFrame("Jump"))
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void CState_Combat::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Combat::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Dodge::CState_Dodge()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Dodge::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Dodge::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Dodge::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Dodge::CheckExitState()
|
||||
{
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT) && m_pOwner->IsCurrentKeyFrame("Dodge"))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK) && m_pOwner->IsCurrentKeyFrame("Dodge"))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JOG) && m_pOwner->IsCurrentKeyFrame("Dodge"))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Dodge::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Dodge::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Idle.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Idle::CState_Idle()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Idle::Enter()
|
||||
{
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::JOG)
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_STOP);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::WALK)
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_STOP);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
}
|
||||
|
||||
void CState_Idle::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Idle::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Idle::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::IDLE_TURN))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE_TURN);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Idle::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Idle::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Idle_Turn.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Idle_Turn::CState_Idle_Turn()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Enter()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_LEFT))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_L);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_RIGHT))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_R);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_DOWN))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_BWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Idle_Turn::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::MOVE))
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::COMBAT))
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Jog.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Jog::CState_Jog()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Jog::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_FWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
|
||||
m_pOwner->Reset_Sprint();
|
||||
m_pOwner->Reset_Walk();
|
||||
}
|
||||
|
||||
void CState_Jog::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Jog::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Jog::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
else if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
else if (!m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Jog::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Jog::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Jump.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Jump::CState_Jump()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Jump::Enter()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_SPRINT);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_JOG);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Jump::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Jump::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Jump::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->IsCurrentKeyFrame("Jump"))
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Jump::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Jump::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Land.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Land::CState_Land()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Land::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Land::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Land::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Land::CheckExitState()
|
||||
{
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Land::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Land::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_LightAttack.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_LightAttack::CState_LightAttack()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_LightAttack::Enter()
|
||||
{
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::LIGHT_ATTACK)
|
||||
return;
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_LightAttack::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_LightAttack::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_LightAttack::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||
{
|
||||
_uint combo = m_pOwner->Next_LightCombo();
|
||||
m_pOwner->Set_LightCombo(combo);
|
||||
if (combo >= 4)
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
return true;
|
||||
}
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK);
|
||||
m_pModel->Set_AnimationIndex(anim.first + combo, anim.second);
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void CState_LightAttack::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_LightAttack::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Move.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Move::CState_Move()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Move::Enter()
|
||||
{
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::IDLE_TURN))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE_TURN);
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CState_Move::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Move::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Move::CheckExitState()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void CState_Move::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Move::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
#include "pch.h"
|
||||
#include "State_Player.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Player::CState_Player()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Player::Enter()
|
||||
{
|
||||
if (nullptr != m_funcEnterEvent) {
|
||||
m_funcEnterEvent();
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CState_Player::Update(_float fTimeDelta)
|
||||
{
|
||||
HRESULT hr = { S_OK };
|
||||
if (nullptr != m_funcExitCheck) {
|
||||
hr = m_funcExitCheck(fTimeDelta);
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
void CState_Player::Exit()
|
||||
{
|
||||
if (nullptr != m_funcExitEvent) {
|
||||
m_funcExitEvent();
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CState_Player::Initialize(STATE_PLAYER_DESC* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_funcExitCheck = pArg->funcExitCheck;
|
||||
m_funcEnterEvent = pArg->funcEnterEvent;
|
||||
m_funcExitEvent = pArg->funcExitEvent;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Player::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Player::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
#include "pch.h"
|
||||
#include "State_Player_Combat.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Player_Combat::CState_Player_Combat()
|
||||
:CState_Player()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Player_Combat::Enter()
|
||||
{
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Combat::Update(_float fTimeDelta)
|
||||
{
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Player_Combat::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Combat::Initialize(STATE_PLAYER_COMBAT_DESC* pDesc)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pOwner = pDesc->pOwner;
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Player_Combat* CState_Player_Combat::Create(STATE_PLAYER_COMBAT_DESC* pDesc)
|
||||
{
|
||||
CState_Player_Combat* pInstance = new CState_Player_Combat;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Player_Combat::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Player_Combat::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#include "pch.h"
|
||||
#include "State_Player_Dodge.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Player_Dodge::CState_Player_Dodge()
|
||||
:CState_Player()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Player_Dodge::Enter()
|
||||
{
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Dodge::Update(_float fTimeDelta)
|
||||
{
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Player_Dodge::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Dodge::Initialize(STATE_PLAYER_DODGE_DESC* pDesc)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Player_Dodge* CState_Player_Dodge::Create(STATE_PLAYER_DODGE_DESC* pDesc)
|
||||
{
|
||||
CState_Player_Dodge* pInstance = new CState_Player_Dodge;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Player_Dodge::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Player_Dodge::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
#include "pch.h"
|
||||
#include "State_Player_Idle.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Player_Idle::CState_Player_Idle()
|
||||
:CState_Player()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Player_Idle::Enter()
|
||||
{
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Idle::Update(_float fTimeDelta)
|
||||
{
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Player_Idle::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Idle::Initialize(STATE_PLAYER_IDLE_DESC* pDesc)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Player_Idle* CState_Player_Idle::Create(STATE_PLAYER_IDLE_DESC* pDesc)
|
||||
{
|
||||
CState_Player_Idle* pInstance = new CState_Player_Idle;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Player_Idle::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Player_Idle::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#include "pch.h"
|
||||
#include "State_Player_Jump.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Player_Jump::CState_Player_Jump()
|
||||
:CState_Player()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Player_Jump::Enter()
|
||||
{
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Jump::Update(_float fTimeDelta)
|
||||
{
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Player_Jump::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Jump::Initialize(STATE_PLAYER_JUMP_DESC* pDesc)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Player_Jump* CState_Player_Jump::Create(STATE_PLAYER_JUMP_DESC* pDesc)
|
||||
{
|
||||
CState_Player_Jump* pInstance = new CState_Player_Jump;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Player_Jump::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Player_Jump::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#include "pch.h"
|
||||
#include "State_Player_Land.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Player_Land::CState_Player_Land()
|
||||
:CState_Player()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Player_Land::Enter()
|
||||
{
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Land::Update(_float fTimeDelta)
|
||||
{
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Player_Land::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Land::Initialize(STATE_PLAYER_LAND_DESC* pDesc)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Player_Land* CState_Player_Land::Create(STATE_PLAYER_LAND_DESC* pDesc)
|
||||
{
|
||||
CState_Player_Land* pInstance = new CState_Player_Land;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Player_Land::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Player_Land::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#include "pch.h"
|
||||
#include "State_Player_Move.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Player_Move::CState_Player_Move()
|
||||
:CState_Player()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Player_Move::Enter()
|
||||
{
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Move::Update(_float fTimeDelta)
|
||||
{
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Player_Move::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
HRESULT CState_Player_Move::Initialize(STATE_PLAYER_MOVE_DESC* pDesc)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Player_Move* CState_Player_Move::Create(STATE_PLAYER_MOVE_DESC* pDesc)
|
||||
{
|
||||
CState_Player_Move* pInstance = new CState_Player_Move;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Player_Move::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Player_Move::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Root.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Root::CState_Root()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Root::Enter()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::COMBAT))
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
else
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
}
|
||||
|
||||
void CState_Root::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Root::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Root::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::COMBAT))
|
||||
{
|
||||
if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::COMBAT)
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_pFSM->Get_Current()->Get_Parent()->Get_State() == FSMSTATE::COMBAT)
|
||||
return false;
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::MOVE))
|
||||
{
|
||||
if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::MOVE)
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void CState_Root::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Root::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Skill.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Skill::CState_Skill()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Skill::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Skill::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Skill::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Skill::CheckExitState()
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Skill::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Skill::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Skill2.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Skill2::CState_Skill2()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Skill2::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL2);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Skill2::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Skill2::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Skill2::CheckExitState()
|
||||
{
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Skill2::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Skill2::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Sprint.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Sprint::CState_Sprint()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Sprint::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SPRINT);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Sprint::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
void CState_Sprint::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Sprint::CheckExitState()
|
||||
{
|
||||
if (!m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
else if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Sprint::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Sprint::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Walk.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Walk::CState_Walk()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Walk::Enter()
|
||||
{
|
||||
if(m_pOwner->Check(FSMSTATE::FWD))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_FWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::BWD))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_BWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
}
|
||||
|
||||
void CState_Walk::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Walk::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Walk::CheckExitState()
|
||||
{
|
||||
if (!m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
else if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Walk::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Walk::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -29,9 +29,13 @@ class CPlayer final : public CUnit
|
||||
_bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; }
|
||||
|
||||
private:
|
||||
unordered_map<size_t, CState*> m_States = { };
|
||||
size_t m_iStateMask = { 0 };
|
||||
|
||||
vector<InputCondition> m_InputConditions;
|
||||
_bool m_bSprintToggle = { false };
|
||||
_bool m_bWalkToggle = { false };
|
||||
|
||||
class CCamPosition_Player* m_pCamPosition_TopDown_LookPart = { nullptr };
|
||||
class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr };
|
||||
private:
|
||||
@@ -50,7 +54,6 @@ class CPlayer final : public CUnit
|
||||
#pragma region STATE
|
||||
private:
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_FSM();
|
||||
virtual void Set_Anim();
|
||||
_bool Check(FSMSTATE::ESTATE state);
|
||||
_bool IsSprint();
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Cast final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Cast();
|
||||
virtual ~CState_Cast() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Combat final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Combat();
|
||||
virtual ~CState_Combat() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Dodge final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Dodge();
|
||||
virtual ~CState_Dodge() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Idle final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Idle();
|
||||
virtual ~CState_Idle() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Idle_Turn final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Idle_Turn();
|
||||
virtual ~CState_Idle_Turn() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
|
||||
class CState_Jog final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Jog();
|
||||
virtual ~CState_Jog() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Jump final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Jump();
|
||||
virtual ~CState_Jump() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Land final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Land();
|
||||
virtual ~CState_Land() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_LightAttack final : public CState
|
||||
{
|
||||
public:
|
||||
CState_LightAttack();
|
||||
virtual ~CState_LightAttack() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Move final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Move();
|
||||
virtual ~CState_Move() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CState_Player abstract : public CState
|
||||
{
|
||||
protected:
|
||||
typedef struct tagStatePlayer : public CState::STATEDESC {
|
||||
function<HRESULT(_float fTimedelta)> funcExitCheck = { nullptr };
|
||||
function<void()> funcEnterEvent = { nullptr };
|
||||
function<void()> funcExitEvent = { nullptr };
|
||||
}STATE_PLAYER_DESC;
|
||||
|
||||
protected:
|
||||
CState_Player();
|
||||
virtual ~CState_Player() = default;
|
||||
|
||||
protected:
|
||||
virtual void Enter() override;
|
||||
virtual HRESULT Update(_float fTimeDelta) override;
|
||||
virtual void Exit() override;
|
||||
|
||||
protected:
|
||||
function<HRESULT(_float fTimedelta)> m_funcExitCheck = { nullptr };
|
||||
function<void()> m_funcEnterEvent = { nullptr };
|
||||
function<void()> m_funcExitEvent = { nullptr };
|
||||
|
||||
protected:
|
||||
HRESULT Initialize(STATE_PLAYER_DESC* pArg);
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State_Player.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CState_Player_Combat final : public CState_Player
|
||||
{
|
||||
public:
|
||||
typedef struct tagCombat : public CState_Player::STATE_PLAYER_DESC {
|
||||
|
||||
}STATE_PLAYER_COMBAT_DESC;
|
||||
private:
|
||||
CState_Player_Combat();
|
||||
virtual ~CState_Player_Combat() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_PLAYER_COMBAT_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Player_Combat* Create(STATE_PLAYER_COMBAT_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State_Player.h"
|
||||
|
||||
class CState_Player_Dodge final : public CState_Player
|
||||
{
|
||||
public:
|
||||
typedef struct tagDodge : public CState_Player::STATE_PLAYER_DESC {
|
||||
|
||||
}STATE_PLAYER_DODGE_DESC;
|
||||
public:
|
||||
CState_Player_Dodge();
|
||||
virtual ~CState_Player_Dodge() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_PLAYER_DODGE_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Player_Dodge* Create(STATE_PLAYER_DODGE_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State_Player.h"
|
||||
|
||||
class CState_Player_Idle final : public CState_Player
|
||||
{
|
||||
public:
|
||||
typedef struct tagIdle : public CState_Player::STATE_PLAYER_DESC {
|
||||
|
||||
}STATE_PLAYER_IDLE_DESC;
|
||||
public:
|
||||
CState_Player_Idle();
|
||||
virtual ~CState_Player_Idle() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_PLAYER_IDLE_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Player_Idle* Create(STATE_PLAYER_IDLE_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State_Player.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CState_Player_Jump final : public CState_Player
|
||||
{
|
||||
public:
|
||||
typedef struct tagJump : public CState_Player::STATE_PLAYER_DESC {
|
||||
|
||||
}STATE_PLAYER_JUMP_DESC;
|
||||
private:
|
||||
CState_Player_Jump();
|
||||
virtual ~CState_Player_Jump() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_PLAYER_JUMP_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Player_Jump* Create(STATE_PLAYER_JUMP_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State_Player.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CState_Player_Land final : public CState_Player
|
||||
{
|
||||
public:
|
||||
typedef struct tagLand : public CState_Player::STATE_PLAYER_DESC {
|
||||
|
||||
}STATE_PLAYER_LAND_DESC;
|
||||
private:
|
||||
CState_Player_Land();
|
||||
virtual ~CState_Player_Land() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_PLAYER_LAND_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Player_Land* Create(STATE_PLAYER_LAND_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State_Player.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CState_Player_Move final : public CState_Player
|
||||
{
|
||||
public:
|
||||
typedef struct tagMove : public CState_Player::STATE_PLAYER_DESC {
|
||||
|
||||
}STATE_PLAYER_MOVE_DESC;
|
||||
private:
|
||||
CState_Player_Move();
|
||||
virtual ~CState_Player_Move() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_PLAYER_MOVE_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Player_Move* Create(STATE_PLAYER_MOVE_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Root final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Root();
|
||||
virtual ~CState_Root() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Skill final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Skill();
|
||||
virtual ~CState_Skill() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Skill2 final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Skill2();
|
||||
virtual ~CState_Skill2() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
|
||||
class CState_Sprint final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Sprint();
|
||||
virtual ~CState_Sprint() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
|
||||
class CState_Walk final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Walk();
|
||||
virtual ~CState_Walk() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -5,12 +5,10 @@
|
||||
CFSM::CFSM(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CComponent(pDevice, pContext)
|
||||
{
|
||||
m_States.resize(FSMSTATE::END);
|
||||
}
|
||||
|
||||
CFSM::CFSM(const CFSM& rhs)
|
||||
: CComponent(rhs),
|
||||
m_States(rhs.m_States)
|
||||
: CComponent(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -24,62 +22,30 @@ HRESULT CFSM::Initialize(void* pArg)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CFSM::Add_State(_uint iIndex, CState* state)
|
||||
void CFSM::Change_State(size_t iStateMask)
|
||||
{
|
||||
m_States[iIndex] = state;
|
||||
m_States[iIndex]->Set_State(iIndex);
|
||||
m_States[iIndex]->Set_Owner(m_pOwner);
|
||||
m_States[iIndex]->Set_Component();
|
||||
if (nullptr != m_pCurrentState) { // 현재 스테이트가 비워져 있으면 우회
|
||||
if (IsEnable(iStateMask)) { // 이미 활성화 된 스테이트면 리턴
|
||||
return;
|
||||
}
|
||||
m_iPreviousStateMask = *m_pStateMask;
|
||||
|
||||
m_pCurrentState->Exit();
|
||||
SAFE_RELEASE(m_pPreviousState); // Prev State 를 지움
|
||||
m_pPreviousState = m_pCurrentState;
|
||||
}
|
||||
|
||||
m_pCurrentState = m_pStates->at(iStateMask);
|
||||
SAFE_ADDREF(m_pCurrentState);
|
||||
m_pCurrentState->Enter();
|
||||
}
|
||||
|
||||
void CFSM::Change_State(_uint iIndex)
|
||||
void CFSM::Update_State(_float fTimeDelta)
|
||||
{
|
||||
m_pPrevious = m_pCurrent;
|
||||
|
||||
if (m_pCurrent)
|
||||
m_pCurrent->Exit();
|
||||
|
||||
m_pCurrent = m_States[iIndex];
|
||||
|
||||
if (m_pCurrent)
|
||||
m_pCurrent->Enter();
|
||||
}
|
||||
|
||||
void CFSM::Update(_float fTimeDelta)
|
||||
{
|
||||
vector<CState*> States;
|
||||
|
||||
CState* pCurrent = m_pCurrent;
|
||||
|
||||
while (pCurrent)
|
||||
if (nullptr != m_pCurrentState)
|
||||
{
|
||||
States.push_back(pCurrent);
|
||||
pCurrent = pCurrent->Get_Parent();
|
||||
m_pCurrentState->Update(fTimeDelta);
|
||||
}
|
||||
|
||||
for (_int i = (_int)States.size() - 1; i >= 0; --i) {
|
||||
States[i]->Update(fTimeDelta);
|
||||
}
|
||||
}
|
||||
|
||||
_uint CFSM::Get_CurrState()
|
||||
{
|
||||
return m_pCurrent->Get_State();
|
||||
}
|
||||
|
||||
_uint CFSM::Get_PrevState()
|
||||
{
|
||||
if (m_pPrevious)
|
||||
return m_pPrevious->Get_State();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CFSM::Set_Parent(FSMSTATE::ESTATE Child, FSMSTATE::ESTATE Parent)
|
||||
{
|
||||
CState* pChild = m_States[Child];
|
||||
CState* pParent = m_States[Parent];
|
||||
if (pChild && pParent)
|
||||
pChild->Set_Parent(pParent);
|
||||
}
|
||||
|
||||
CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
@@ -95,7 +61,7 @@ CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CComponent* CFSM::Clone(void* pArg, class CGameObject* pOwner)
|
||||
CFSM* CFSM::Clone(void* pArg, class CGameObject* pOwner)
|
||||
{
|
||||
CFSM* pInstance = new CFSM(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
@@ -112,14 +78,16 @@ void CFSM::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pCurrent);
|
||||
SAFE_RELEASE(m_pPrevious);
|
||||
SAFE_RELEASE(m_pCurrentState);
|
||||
SAFE_RELEASE(m_pPreviousState);
|
||||
|
||||
for (auto& states : m_States)
|
||||
{
|
||||
SAFE_RELEASE(states);
|
||||
if (nullptr != m_pStates) {
|
||||
unordered_map<size_t, class CState*>::iterator iter = m_pStates->begin();
|
||||
for (; iter != m_pStates->end(); ++iter) {
|
||||
SAFE_RELEASE(iter->second);
|
||||
}
|
||||
m_pStates = nullptr;
|
||||
}
|
||||
m_States.clear();
|
||||
}
|
||||
|
||||
void CFSM::Describe_Entity()
|
||||
|
||||
@@ -9,32 +9,10 @@ CState::CState()
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
void CState::Enter()
|
||||
HRESULT CState::Initialize(STATEDESC* pArg)
|
||||
{
|
||||
}
|
||||
|
||||
void CState::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CState::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState::CheckExitState()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CState::Set_Owner(CGameObject* pOwner)
|
||||
{
|
||||
m_pOwner = dynamic_cast<CUnit*>(pOwner);
|
||||
};
|
||||
|
||||
void CState::Set_Component()
|
||||
{
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
m_pOwner = pArg->pOwner;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState::Free()
|
||||
@@ -42,7 +20,6 @@ void CState::Free()
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pParent);
|
||||
}
|
||||
|
||||
void CState::Describe_Entity()
|
||||
|
||||
@@ -20,33 +20,47 @@ class CState;
|
||||
|
||||
class ENGINE_DLL CFSM final : public CComponent
|
||||
{
|
||||
public:
|
||||
typedef struct tagFSMDesc
|
||||
{
|
||||
unordered_map<size_t, class CState*>* pStates = { nullptr };
|
||||
size_t* pStateMask = { nullptr };
|
||||
}FSM_DESC;
|
||||
private:
|
||||
CFSM(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CFSM(const CFSM& rhs);
|
||||
virtual ~CFSM() = default;
|
||||
|
||||
public:
|
||||
void Add_State(_uint iIndex, CState* state);
|
||||
void Change_State(_uint iIndex);
|
||||
void Update(_float fTimeDelta);
|
||||
void Change_State(size_t iStateMask);
|
||||
void Update_State(_float fTimeDelta);
|
||||
|
||||
CState* Get_PrevState() { return m_pPreviousState; }
|
||||
size_t Get_PrevStateMask() { return m_iPreviousStateMask; }
|
||||
|
||||
//inline void Enable_State(size_t stateMask) { *m_pStateMask |= stateMask; }
|
||||
//inline void Set_State(size_t initialStateMask) { *m_pStateMask = initialStateMask; }
|
||||
//inline void Disable_State(size_t stateMask) { *m_pStateMask &= ~stateMask; }
|
||||
|
||||
inline _bool IsEnable(size_t stateMask) const { return (*m_pStateMask & stateMask) != 0; }
|
||||
inline _bool IsEnable_Previous(size_t stateMask) const { return (m_iPreviousStateMask & stateMask) != 0; }
|
||||
|
||||
CState* Get_Current() { return m_pCurrent; }
|
||||
_uint Get_CurrState();
|
||||
_uint Get_PrevState();
|
||||
void Set_Parent(FSMSTATE::ESTATE Child, FSMSTATE::ESTATE Parent);
|
||||
private:
|
||||
vector<CState*> m_States;
|
||||
CState* m_pCurrent = { nullptr };
|
||||
CState* m_pPrevious = { nullptr };
|
||||
unordered_map<size_t, class CState*>* m_pStates = { nullptr };
|
||||
size_t* m_pStateMask = { nullptr };
|
||||
|
||||
size_t m_iPreviousStateMask = { 0 };
|
||||
|
||||
CState* m_pCurrentState = { nullptr };
|
||||
CState* m_pPreviousState = { nullptr };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
|
||||
public:
|
||||
static CFSM* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual CFSM* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
@@ -22,33 +22,31 @@ class CUnit;
|
||||
class CModel;
|
||||
class CFSM;
|
||||
class CGameInstance;
|
||||
|
||||
class ENGINE_DLL CState abstract : public CBase
|
||||
{
|
||||
protected:
|
||||
typedef struct tagStateDesc {
|
||||
class CUnit* pOwner = { nullptr };
|
||||
}STATEDESC;
|
||||
|
||||
protected:
|
||||
CState();
|
||||
virtual ~CState() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
void Set_Owner(class CGameObject* pOwner);
|
||||
virtual void Set_Component();
|
||||
virtual void Enter()PURE;
|
||||
virtual HRESULT Update(_float fTimeDelta)PURE;
|
||||
virtual void Exit()PURE;
|
||||
|
||||
void Set_State(_uint State) { m_eState = State; }
|
||||
_uint Get_State() { return m_eState; }
|
||||
void Set_Parent(CState* State) { m_pParent = State; }
|
||||
CState* Get_Parent() { return m_pParent; }
|
||||
protected:
|
||||
CUnit* m_pOwner = { nullptr };
|
||||
CModel* m_pModel = { nullptr };
|
||||
CFSM* m_pFSM = { nullptr };
|
||||
CState* m_pParent = { nullptr };
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
_uint m_eState = {};
|
||||
|
||||
|
||||
protected:
|
||||
HRESULT Initialize(STATEDESC* pArg);
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
|
||||
Reference in New Issue
Block a user