parkingcenter.h

来自「天之炼狱1服务器端源文件游戏服务端不完整」· C头文件 代码 · 共 98 行

H
98
字号
//////////////////////////////////////////////////////////////////////////////// Filename    : ParkingCenter.h// Written By  : Reiot// Description : //////////////////////////////////////////////////////////////////////////////#ifndef __PARKING_CENTER_H__#define __PARKING_CENTER_H__#include "Types.h"#include "Exception.h"#include "Zone.h"#include "item/Motorcycle.h"#include "Mutex.h"#include <hash_map>#include <list>//////////////////////////////////////////////////////////////////////////////// class MotorcycleBox//////////////////////////////////////////////////////////////////////////////class MotorcycleBox {public:	MotorcycleBox(Motorcycle* pMotorcycle, Zone* pZone, ZoneCoord_t X, ZoneCoord_t Y) throw();	virtual ~MotorcycleBox() throw();public:	Motorcycle* getMotorcycle() throw() { return m_pMotorcycle; }	void setMotorcycle(Motorcycle* pMotorcycle) throw() { m_pMotorcycle = pMotorcycle; }	Zone* getZone() const throw() { return m_pZone; }	void setZone(Zone* pZone) throw() { m_pZone = pZone; }	ZoneCoord_t getX() const throw() { return m_X; }	void setX(ZoneCoord_t X) throw() { m_X = X; }	ZoneCoord_t getY() const throw() { return m_Y; }	void setY(ZoneCoord_t Y) throw() { m_Y = Y; }	ItemID_t getItemID() const throw() { return m_pMotorcycle->getItemID(); }	// 促弗 zone栏肺 捞悼吝牢 坷配官捞	bool isTransport() const throw() 		{ return m_bTransport; }	void setTransport(bool bTransport=true) { m_bTransport = bTransport; }private:	// 葛配荤捞努 夯眉	Motorcycle* m_pMotorcycle;	// 泅犁 葛配荤捞努捞 乐绰 困摹	Zone* m_pZone;	ZoneCoord_t m_X;	ZoneCoord_t m_Y;	// 促弗 zone栏肺 捞悼 吝. by sigi. 2002.5.23	bool m_bTransport;};//////////////////////////////////////////////////////////////////////////////// class ParkingCenter;//////////////////////////////////////////////////////////////////////////////class ParkingCenter {public: 	ParkingCenter() throw();	virtual ~ParkingCenter() throw();	public:	void addMotorcycleBox(MotorcycleBox* pMotorcycleBox) throw(DuplicatedException, Error);	// 咯扁辑 keyID绰 凯艰狼 TargetID甫 舵茄促. 肚茄 Motorcycle狼 ItemID捞扁档 窍促.	void deleteMotorcycleBox(ItemID_t keyTargetID) throw(NoSuchElementException, Error);	// 咯扁辑 keyID绰 凯艰狼 TargetID甫 舵茄促. 肚茄 Motorcycle狼 ItemID捞扁档 窍促.	bool hasMotorcycleBox(ItemID_t keyTargetID) throw(NoSuchElementException, Error);	// 咯扁辑 keyID绰 凯艰狼 TargetID甫 舵茄促. 肚茄 Motorcycle狼 ItemID捞扁档 窍促.	MotorcycleBox* getMotorcycleBox(ItemID_t keyTargetID) const throw(NoSuchElementException, Error);	// 林肺 RemoveMotorcycles甫 贸府秦霖促. by sigi. 2003.2.26	void	heartbeat() throw (Error);private:	// 咯扁辑 ItemID_t绰 坷配官捞狼 ItemID甫 富茄促.	hash_map< ItemID_t, MotorcycleBox* > 	m_Motorcycles;	list< MotorcycleBox* > 					m_RemoveMotorcycles;	mutable Mutex m_Mutex;	mutable Mutex m_MutexRemove;};// global variable declarationextern ParkingCenter* g_pParkingCenter;#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?