TrinityCore
Loading...
Searching...
No Matches
MapObject.h
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef MapObject_h__
19
#define MapObject_h__
20
21
#include "
Define.h
"
22
#include "
Cell.h
"
23
#include "
Position.h
"
24
25
class
Map
;
26
class
ObjectGridLoader
;
27
28
enum
MapObjectCellMoveState
29
{
30
MAP_OBJECT_CELL_MOVE_NONE
,
//not in move list
31
MAP_OBJECT_CELL_MOVE_ACTIVE
,
//in move list
32
MAP_OBJECT_CELL_MOVE_INACTIVE
,
//in move list but should not move
33
};
34
35
class
TC_GAME_API
MapObject
36
{
37
friend
class
Map
;
//map for moving creatures
38
friend
class
ObjectGridLoaderBase
;
//grid loader for loading creatures
39
40
protected
:
41
MapObject
() : _moveState(
MAP_OBJECT_CELL_MOVE_NONE
)
42
{
43
_newPosition.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
44
}
45
46
private
:
47
Cell
_currentCell
;
48
Cell
const
&
GetCurrentCell
()
const
{
return
_currentCell; }
49
void
SetCurrentCell
(
Cell
const
& cell) { _currentCell = cell; }
50
51
MapObjectCellMoveState
_moveState
;
52
Position
_newPosition
;
53
void
SetNewCellPosition
(
float
x,
float
y,
float
z,
float
o)
54
{
55
_moveState =
MAP_OBJECT_CELL_MOVE_ACTIVE
;
56
_newPosition.
Relocate
(x, y, z, o);
57
}
58
};
59
60
#endif
// MapObject_h__
Cell.h
Define.h
TC_GAME_API
#define TC_GAME_API
Definition
Define.h:129
MapObjectCellMoveState
MapObjectCellMoveState
Definition
MapObject.h:29
MAP_OBJECT_CELL_MOVE_INACTIVE
@ MAP_OBJECT_CELL_MOVE_INACTIVE
Definition
MapObject.h:32
MAP_OBJECT_CELL_MOVE_ACTIVE
@ MAP_OBJECT_CELL_MOVE_ACTIVE
Definition
MapObject.h:31
MAP_OBJECT_CELL_MOVE_NONE
@ MAP_OBJECT_CELL_MOVE_NONE
Definition
MapObject.h:30
Position.h
MapObject::_currentCell
Cell _currentCell
Definition
MapObject.h:47
MapObject::SetCurrentCell
void SetCurrentCell(Cell const &cell)
Definition
MapObject.h:49
MapObject::_moveState
MapObjectCellMoveState _moveState
Definition
MapObject.h:51
MapObject::MapObject
MapObject()
Definition
MapObject.h:41
MapObject::_newPosition
Position _newPosition
Definition
MapObject.h:52
MapObject::SetNewCellPosition
void SetNewCellPosition(float x, float y, float z, float o)
Definition
MapObject.h:53
MapObject::GetCurrentCell
Cell const & GetCurrentCell() const
Definition
MapObject.h:48
Map
Definition
Map.h:225
ObjectGridLoaderBase
Definition
ObjectGridLoader.h:31
ObjectGridLoader
Definition
ObjectGridLoader.h:55
MapObject
Definition
wmo.h:169
Cell
Definition
Cell.h:47
Position
Definition
Position.h:30
Position::Relocate
constexpr void Relocate(float x, float y)
Definition
Position.h:74
server
game
Maps
MapObject.h
Generated on Sun May 10 2026 02:09:00 for TrinityCore by
1.9.8