1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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
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
);
49 SPosition(): X(0), Y(0), Tick(0) {}
51 typedef std::map
<TDataSetRow
,SPosition
> TPositions
;
52 TPositions _Positions
;