-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnpc.h
More file actions
49 lines (42 loc) · 784 Bytes
/
npc.h
File metadata and controls
49 lines (42 loc) · 784 Bytes
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
46
47
48
49
#pragma once
#include <utility>
#include "ppc_exc.h"
#include "lcg.h"
#include "ram.h"
using namespace std;
enum states { WAITING = 0, FIRST_WALK = 1, WALKING = 2, STOPPING = 3 };
class NPC {
public:
NPC(LCG& global_lcg,
RAM& global_ram,
int npc_adr,
int pos_adr,
int npc_num,
float startX,
float startY);
LCG& lcg;
RAM& ram;
int npc_address;
int pos_address;
int npc_number;
int state;
float startingX;
float startingY;
float currentX;
float currentY;
float destX;
float destY;
float nextX;
float nextY;
float walk_speed;
float wait_time;
int step_count;
bool first_step;
bool debug;
void step();
void set_wait_time();
void wait();
void set_walk_params();
pair <float, float> calc_walk(float givenX, float givenY);
void print_state();
};