-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnemyState.h
45 lines (38 loc) · 2.07 KB
/
EnemyState.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "IState.h"
#include "VisPredStructs.h"
struct EnemyComponent;
struct TransformComponent;
class EnemyState : public virtual IState
{
public:
/// <summary>
/// 플레이어가 범위 내에 있는지 탐지하고 상태를 변경한다.
/// 플레이어가 감지 되었다면 플레이어 까지의 거리를 반환한다. 감지하지 못하엿을 경우는 0을 반환
/// </summary>
static float DetectTarget(EnemyComponent& enemyComp, float deltaTime);
/// <summary>
/// Enemy의 HP를 확인하고 0 이하이면 true 를 반환
/// </summary>
static bool CheckIsDead(const std::shared_ptr<EnemyComponent>& enemyComponent);
/// <summary>
/// 시야 범위, 소음 범위, 추격 범위를 생성하여 반환
/// </summary>
static void CreateDetectionAreas(const EnemyComponent& enemyComp, const TransformComponent* transform, DirectX::BoundingFrustum& viewRangeOutput, DirectX::BoundingSphere& noiseRangeOutput, DirectX::BoundingSphere& chaseRangeOutput);
/// <summary>
/// 플레이어를 향해 회전하고 거의 다 회전하였다면 true를 반환
/// </summary>
static bool RotateToTarget(TransformComponent* transform, VisPred::SimpleMath::Vector3 targetDir, float deltaTime);
/// <summary>
/// 현재 상태를 변환하고 Enter 함수를 호출한다. 이전 상태는 Exit 함수를 호출한다.
/// </summary>
static void ChangeCurrentState(const std::shared_ptr<EnemyComponent>& enemyComponent, IState* newState);
static void ChangeCurrentState(EnemyComponent& enemyComponent, IState* newState);
/// <summary>
/// 현재 애니메이션 변경
/// </summary>
static void ChangeCurrentAnimation(EnemyComponent& enemyComp, VisPred::Game::EnemyAni animation, float speed, float transitionTime = 0.1f, bool isLoop = true, bool isAgain = false, bool isImmediate = false);
static void ChangeCurrentAnimation(const std::shared_ptr<EnemyComponent>& enemyComp, VisPred::Game::EnemyAni animation, float speed, float transitionTime = 0.1f, bool isLoop = true, bool isAgain = false, bool isImmediate = false);
static void DrawDebugDraw(const EnemyComponent& enemyComp, DirectX::BoundingFrustum& viewRangeOutput, DirectX::BoundingSphere& noiseRangeOutput,
DirectX::BoundingSphere& chaseRangeOutput);
};