source: network-game/common/Projectile.h@ ea3a3a9

Last change on this file since ea3a3a9 was 9ba9b96, checked in by dportnoy <dmp1488@…>, 11 years ago

All ids should now be unsigned ints

  • Property mode set to 100644
File size: 694 bytes
Line 
1#ifndef _PROJECTILE_H
2#define _PROJECTILE_H
3
4#include <string>
5#include <map>
6
7#include "Common.h"
8#include "WorldMap.h"
9#include "Player.h"
10
11using namespace std;
12
13class Projectile {
14public:
15 unsigned int id;
16 POSITION pos;
17 unsigned int target;
18 int speed;
19 int damage;
20 unsigned long long timeLastUpdated;
21
22 Projectile();
23 Projectile(const Projectile& p);
24 Projectile(int x, int y, int targetId, int damage);
25
26 ~Projectile();
27
28 void setId(unsigned int id);
29
30 void serialize(char* buffer);
31 void deserialize(char* buffer);
32
33 // returns true if the projectile reached the target and should be deleted
34 bool move(map<unsigned int, Player*>& mapPlayers);
35};
36
37#endif
Note: See TracBrowser for help on using the repository browser.