Add infos into target window
[ryzomcore.git] / ryzom / server / src / gpm_service / move_checker.h
blob40cc2aab5b32d5706ce960acb2ce2a5abf7c6e58
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/>.
17 #ifndef MOVE_CHECKER_H
18 #define MOVE_CHECKER_H
20 #include "nel/misc/types_nl.h"
21 #include "nel/misc/smart_ptr.h"
23 #include "game_share/base_types.h"
26 class CMoveChecker: public NLMISC::CRefCount
28 public:
29 // inform the move checker that a player is being teleported - the move checker performs no test but
30 // updates internal info on player position
31 void teleport(TDataSetRow entityIndex, sint32 x, sint32 y, uint32 tick);
33 // ensure that the move attempted by a player is legal
34 // if the move is not valid then x, y and z are changed to make the move valid
35 // return true if move is valid otherwise false
36 bool checkMove(TDataSetRow entityIndex, sint32& x, sint32& y, uint32 tick);
38 // remove a player from the checker (when they have deconnect)
39 void remove(TDataSetRow entityIndex);
41 private:
42 // private data
44 struct SPosition
46 sint32 X, Y;
47 uint32 Tick;
49 SPosition(): X(0), Y(0), Tick(0) {}
51 typedef std::map<TDataSetRow,SPosition> TPositions;
52 TPositions _Positions;
55 #endif