TrinityCore
Loading...
Searching...
No Matches
PhasingHandler.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 PhasingHandler_h__
19
#define PhasingHandler_h__
20
21
#include "
Define.h
"
22
#include <string>
23
#include <vector>
24
25
class
ChatHandler
;
26
class
ObjectGuid
;
27
class
PhaseShift
;
28
class
Player
;
29
class
TerrainInfo
;
30
class
WorldObject
;
31
namespace
WorldPackets
32
{
33
namespace
Party
34
{
35
struct
PartyMemberPhaseStates
;
36
}
37
}
38
39
class
TC_GAME_API
PhasingHandler
40
{
41
public
:
42
static
void
AddPhase(
WorldObject
*
object
,
uint32
phaseId,
bool
updateVisibility);
43
static
void
RemovePhase(
WorldObject
*
object
,
uint32
phaseId,
bool
updateVisibility);
44
static
void
AddPhaseGroup(
WorldObject
*
object
,
uint32
phaseGroupId,
bool
updateVisibility);
45
static
void
RemovePhaseGroup(
WorldObject
*
object
,
uint32
phaseGroupId,
bool
updateVisibility);
46
47
static
void
AddVisibleMapId(
WorldObject
*
object
,
uint32
visibleMapId);
48
static
void
RemoveVisibleMapId(
WorldObject
*
object
,
uint32
visibleMapId);
49
50
static
void
ResetPhaseShift(
WorldObject
*
object
);
51
static
void
InheritPhaseShift(
WorldObject
* target,
WorldObject
const
* source);
52
53
static
void
OnMapChange(
WorldObject
*
object
);
54
static
void
OnAreaChange(
WorldObject
*
object
);
55
static
bool
OnConditionChange(
WorldObject
*
object
,
bool
updateVisibility =
true
);
56
57
static
void
SendToPlayer(
Player
const
* player,
PhaseShift
const
& phaseShift);
58
static
void
SendToPlayer(
Player
const
* player);
59
static
void
FillPartyMemberPhase(
WorldPackets::Party::PartyMemberPhaseStates
* partyMemberPhases,
PhaseShift
const
& phaseShift);
60
61
static
PhaseShift
const
& GetEmptyPhaseShift();
62
static
PhaseShift
const
& GetAlwaysVisiblePhaseShift();
63
static
void
InitDbPhaseShift(
PhaseShift
& phaseShift,
uint8
phaseUseFlags,
uint16
phaseId,
uint32
phaseGroupId);
64
static
void
InitDbPersonalOwnership(
PhaseShift
& phaseShift,
ObjectGuid
const
& personalGuid);
65
static
void
InitDbVisibleMapId(
PhaseShift
& phaseShift,
int32
visibleMapId);
66
static
bool
InDbPhaseShift(
WorldObject
const
*
object
,
uint8
phaseUseFlags,
uint16
phaseId,
uint32
phaseGroupId);
67
68
static
uint32
GetTerrainMapId(
PhaseShift
const
& phaseShift,
uint32
mapId,
TerrainInfo
const
* terrain,
float
x,
float
y);
69
70
static
void
SetAlwaysVisible(
WorldObject
*
object
,
bool
apply,
bool
updateVisibility);
71
static
void
SetInversed(
WorldObject
*
object
,
bool
apply,
bool
updateVisibility);
72
73
static
void
PrintToChat(
ChatHandler
* chat,
WorldObject
const
* target);
74
static
std::string FormatPhases(
PhaseShift
const
& phaseShift);
75
76
static
bool
IsPersonalPhase(
uint32
phaseId);
77
78
private
:
79
class
ControlledUnitVisitor
;
80
friend
ControlledUnitVisitor
;
81
82
static
void
AddPhase(
WorldObject
*
object
,
uint32
phaseId,
ObjectGuid
const
& personalGuid,
bool
updateVisibility,
ControlledUnitVisitor
& visitor);
83
static
void
RemovePhase(
WorldObject
*
object
,
uint32
phaseId,
bool
updateVisibility,
ControlledUnitVisitor
& visitor);
84
static
void
AddPhaseGroup(
WorldObject
*
object
, std::vector<uint32>
const
* phasesInGroup,
ObjectGuid
const
& personalGuid,
bool
updateVisibility,
ControlledUnitVisitor
& visitor);
85
static
void
RemovePhaseGroup(
WorldObject
*
object
, std::vector<uint32>
const
* phasesInGroup,
bool
updateVisibility,
ControlledUnitVisitor
& visitor);
86
static
void
AddVisibleMapId(
WorldObject
*
object
,
uint32
visibleMapId,
ControlledUnitVisitor
& visitor);
87
static
void
RemoveVisibleMapId(
WorldObject
*
object
,
uint32
visibleMapId,
ControlledUnitVisitor
& visitor);
88
static
void
UpdateVisibilityIfNeeded(
WorldObject
*
object
,
bool
updateVisibility,
bool
changed);
89
};
90
91
#endif
// PhasingHandler_h__
Define.h
TC_GAME_API
#define TC_GAME_API
Definition
Define.h:129
uint8
uint8_t uint8
Definition
Define.h:156
int32
int32_t int32
Definition
Define.h:150
uint16
uint16_t uint16
Definition
Define.h:155
uint32
uint32_t uint32
Definition
Define.h:154
HighGuid::Party
@ Party
ChatHandler
Definition
Chat.h:39
ObjectGuid
Definition
ObjectGuid.h:308
PhaseShift
Definition
PhaseShift.h:55
PhasingHandler::ControlledUnitVisitor
Definition
PhasingHandler.cpp:65
PhasingHandler
Definition
PhasingHandler.h:40
PhasingHandler::ControlledUnitVisitor
friend ControlledUnitVisitor
Definition
PhasingHandler.h:80
Player
Definition
Player.h:1233
TerrainInfo
Definition
TerrainMgr.h:39
WorldObject
Definition
Object.h:281
WorldPackets
Definition
GameObjectAI.h:36
WorldPackets::Party::PartyMemberPhaseStates
Definition
PartyPackets.h:160
server
game
Phasing
PhasingHandler.h
Generated on Sun May 10 2026 02:09:01 for TrinityCore by
1.9.8