forked from wingzero0/GameProgramming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BattleRoom.h
31 lines (27 loc) · 949 Bytes
/
BattleRoom.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
#pragma once
#include "TheFlyWin32.h"
#include "GameControl.h"
#include "AIControl.h"
#include "ActorStateMachine.h"
#define BATTLE_RADIUS 25000.0
#include <map>
class BattleRoom
{
protected:
ActorStateMachine *playerStateMachine;
std::vector<ActorStateMachine *> npcStateMachineList; // they are candidates, not always in the arean.
std::vector<ActorStateMachine *> AreanList;
std::map<ACTORid, BOOL> playerHitMap;
std::map<ACTORid, BOOL> npcHitMap;
public:
BattleRoom(void);
virtual ~BattleRoom(void);
BattleRoom(ActorStateMachine *playerStateMachine, std::vector<ActorStateMachine *> npcStateMachineList);
void RefreshArena();
void PerformAttack();
BOOL hurt;
protected:
BOOL JoinArena(ActorStateMachine * npcStm);
BOOL CheckDistanceAndState(float playerPos[3], float npcPos[3], ActorState playerState,ActorState npcState );
BOOL AttackCheck(float attackerDir[3], float attackerPos[3], float vitimPos[3], float attackRange);
};