*Backed out changeset 3be01fb200a5
--HG-- branch : trunk
This commit is contained in:
@@ -17,12 +17,16 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef TRANSPORTS_H
|
||||
#define TRANSPORTS_H
|
||||
|
||||
#include "GameObject.h"
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
class TransportPath
|
||||
{
|
||||
public:
|
||||
@@ -33,32 +37,40 @@ class TransportPath
|
||||
uint32 actionFlag;
|
||||
uint32 delay;
|
||||
};
|
||||
|
||||
void SetLength(const unsigned int sz)
|
||||
{
|
||||
i_nodes.resize( sz );
|
||||
}
|
||||
|
||||
unsigned int Size(void) const { return i_nodes.size(); }
|
||||
bool Empty(void) const { return i_nodes.empty(); }
|
||||
void Resize(unsigned int sz) { i_nodes.resize(sz); }
|
||||
void Clear(void) { i_nodes.clear(); }
|
||||
PathNode* GetNodes(void) { return static_cast<PathNode *>(&i_nodes[0]); }
|
||||
|
||||
PathNode& operator[](const unsigned int idx) { return i_nodes[idx]; }
|
||||
const PathNode& operator()(const unsigned int idx) const { return i_nodes[idx]; }
|
||||
|
||||
protected:
|
||||
std::vector<PathNode> i_nodes;
|
||||
};
|
||||
|
||||
class Transport : public GameObject
|
||||
{
|
||||
public:
|
||||
explicit Transport();
|
||||
|
||||
bool Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags);
|
||||
bool GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids);
|
||||
void Update(uint32 p_time);
|
||||
bool AddPassenger(Player* passenger);
|
||||
bool RemovePassenger(Player* passenger);
|
||||
void CheckForEvent(uint32 entry, uint32 wp_id);
|
||||
|
||||
typedef std::set<Player*> PlayerSet;
|
||||
PlayerSet const& GetPassengers() const { return m_passengers; }
|
||||
|
||||
private:
|
||||
struct WayPoint
|
||||
{
|
||||
@@ -72,16 +84,21 @@ class Transport : public GameObject
|
||||
bool teleport;
|
||||
uint32 id;
|
||||
};
|
||||
|
||||
typedef std::map<uint32, WayPoint> WayPointMap;
|
||||
|
||||
WayPointMap::const_iterator m_curr;
|
||||
WayPointMap::const_iterator m_next;
|
||||
uint32 m_pathTime;
|
||||
uint32 m_timer;
|
||||
|
||||
PlayerSet m_passengers;
|
||||
|
||||
public:
|
||||
WayPointMap m_WayPoints;
|
||||
uint32 m_nextNodeTime;
|
||||
uint32 m_period;
|
||||
|
||||
private:
|
||||
void TeleportTransport(uint32 newMapid, float x, float y, float z);
|
||||
void UpdateForMap(Map const* map);
|
||||
|
||||
Reference in New Issue
Block a user