SQCSimulator2023/SQCSim-common/bullet.h

36 lines
671 B
C
Raw Normal View History

2023-09-18 15:56:17 -04:00
#ifndef BULLET_H__
#define BULLET_H__
2023-09-30 14:54:39 -04:00
2023-11-06 13:56:12 -05:00
#include <unordered_map>
2023-09-29 17:02:57 -04:00
#include "define.h"
#include "vector3.h"
2023-10-30 14:36:44 -04:00
#include "player.h"
2023-12-05 13:44:54 -05:00
#include "netprotocol.h"
2023-10-30 14:56:04 -04:00
2023-09-18 15:56:17 -04:00
class World;
2023-10-30 14:36:44 -04:00
class Player;
2023-09-18 15:56:17 -04:00
class Bullet {
public:
2023-09-29 17:02:57 -04:00
Bullet(Vector3f pos, Vector3f dir);
Bullet(Vector3f pos, Vector3f dir, uint64_t tid);
2023-09-18 15:56:17 -04:00
~Bullet();
2023-12-05 13:44:54 -05:00
bool Update(World* world, float elapsedtime, int perframe, std::unordered_map<uint64_t, Player*> m_mapPlayer, netprot::ChunkMod** chunkmod);
2023-09-18 15:56:17 -04:00
void Transpose(int& x, int& z);
2023-10-16 12:02:37 -04:00
Vector3f getPos() const;
Vector3f getVel() const;
2023-09-29 17:02:57 -04:00
uint64_t getTeamID();
2023-09-18 15:56:17 -04:00
private:
2023-09-29 17:02:57 -04:00
Vector3f m_startpos,
m_currentpos,
m_velocity;
uint64_t m_tid = 0;
2023-10-30 14:36:44 -04:00
2023-09-18 15:56:17 -04:00
};
#endif // BULLET_H__