Movement manager add

This commit is contained in:
KimLS
2018-09-17 14:32:36 -07:00
parent c677169edd
commit 2224b83ae0
15 changed files with 342 additions and 127 deletions
+38
View File
@@ -0,0 +1,38 @@
#pragma once
#include <memory>
class Mob;
class Client;
class MobMovementManager
{
public:
~MobMovementManager();
void Process();
void AddMob(Mob *m);
void RemoveMob(Mob *m);
void AddClient(Client *c);
void RemoveClient(Client *c);
void SendPosition(Mob *who);
void SendPositionUpdate(Mob *who, bool send_to_self);
static MobMovementManager &Get() {
static MobMovementManager inst;
return inst;
}
private:
MobMovementManager();
MobMovementManager(const MobMovementManager&);
MobMovementManager& operator=(const MobMovementManager&);
bool HeadingEqual(float a, float b);
void SendUpdateTo(Mob *who, Client *c, int anim, float heading);
void SendUpdate(Mob *who, int anim, float heading);
void SendUpdateShortDistance(Mob *who, int anim, float heading);
void SendUpdateLongDistance(Mob *who, int anim, float heading);
struct Implementation;
std::unique_ptr<Implementation> _impl;
};