Add infos into target window
[ryzomcore.git] / ryzom / server / src / entities_game_service / stables / stable.h
blob901cfc50ba03c45a0e95185f9cb2ac2b2838083e
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef RYZOM_STABLE_H
20 #define RYZOM_STABLE_H
22 #include "game_share/continent.h"
23 #include "server_share/respawn_point_type.h"
24 #include "server_share/entity_state.h"
26 /**
27 * CStable
28 * \author Alain Saffray
29 * \author Nevrax France
30 * \date 2003
31 * \Manage Stables for pet animals
33 class CStable
35 NL_INSTANCE_COUNTER_DECL(CStable);
36 public:
38 struct TStableData
40 std::string StableName;
41 CONTINENT::TContinent Continent;
42 sint32 StableExitX;
43 sint32 StableExitY;
44 sint32 StableExitZ;
45 float Theta;
48 typedef std::map< uint16, TStableData > TStableContainer;
50 // initialize
51 static CStable* getInstance()
53 if(_Instance == NULL)
55 _Instance = new CStable();
57 return _Instance;
60 /// constructor
61 CStable();
63 /// destructor
64 virtual ~CStable();
66 /// add a stable
67 void addStable( const std::string& stableName, uint16 placeId, const std::string& continent, float x, float y, float z, float theta );
69 /// return stable entry point coordinate
70 bool getStableData( uint16 placeId, TStableData& stableData ) const;
72 /// return true if name corresponding to a stable
73 inline bool isStable( uint16 placeId ) const { return _Stables.find( placeId ) != _Stables.end(); }
75 private:
76 // singleton instance
77 static CStable * _Instance;
79 // re-spawn name and datas
80 TStableContainer _Stables;
82 #endif // RYZOM_STABLE_H
84 /* End of file stable.h */