AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
WGWorkshop Struct Reference

#include "BattlefieldWG.h"

Public Member Functions

 WGWorkshop (BattlefieldWG *_bf, uint8 _workshopId)
 
bool IsCapturable () const
 
void GiveControlTo (TeamId team, bool init)
 
void UpdateGraveyardAndWorkshop ()
 
void Save ()
 

Public Attributes

BattlefieldWGbf
 
uint8 workshopId
 
TeamId teamControl
 
uint32 state
 

Detailed Description

Constructor & Destructor Documentation

◆ WGWorkshop()

WGWorkshop::WGWorkshop ( BattlefieldWG _bf,
uint8  _workshopId 
)
inline
1416 {
1417 ASSERT(_bf && _workshopId < WG_MAX_WORKSHOP);
1418
1419 bf = _bf;
1420 workshopId = _workshopId;
1423 }
uint8 const WG_MAX_WORKSHOP
Definition BattlefieldWG.h:1025
@ BATTLEFIELD_WG_OBJECTSTATE_NONE
Definition BattlefieldWG.h:482
#define ASSERT
Definition Errors.h:68
@ TEAM_NEUTRAL
Definition SharedDefines.h:750
TeamId teamControl
Definition BattlefieldWG.h:1411
uint32 state
Definition BattlefieldWG.h:1413
uint8 workshopId
Definition BattlefieldWG.h:1409
BattlefieldWG * bf
Definition BattlefieldWG.h:1407

References ASSERT, BATTLEFIELD_WG_OBJECTSTATE_NONE, bf, state, TEAM_NEUTRAL, teamControl, WG_MAX_WORKSHOP, and workshopId.

Member Function Documentation

◆ GiveControlTo()

void WGWorkshop::GiveControlTo ( TeamId  team,
bool  init 
)
inline
1429 {
1430 switch (team)
1431 {
1432 case TEAM_NEUTRAL:
1433 {
1434 // Send warning message to all player to inform a faction attack to a workshop
1435 // alliance / horde attacking a workshop
1436 bf->SendWarning(teamControl ? WorkshopsData[workshopId].attackText : (WorkshopsData[workshopId].attackText + 2));
1437
1438 // Updating worldstate, update icon to neutral
1441
1442 // Found associate graveyard and update it
1443 if (IsCapturable())
1446
1447 teamControl = team;
1448 break;
1449 }
1450 case TEAM_ALLIANCE:
1451 case TEAM_HORDE:
1452 {
1453 // Updating worldstate
1456
1457 // Warning message
1458 if (!init) // workshop taken - alliance
1459 bf->SendWarning(team == TEAM_ALLIANCE ? WorkshopsData[workshopId].takenText : (WorkshopsData[workshopId].takenText + 2));
1460
1461 // Found associate graveyard and update it
1462 if (IsCapturable())
1465
1466 teamControl = team;
1467 break;
1468 }
1469 }
1470
1471 if (!init)
1472 {
1473 bf->UpdateCounterVehicle(false);
1475
1476 // Workshop graveyard share the workshop id; repop ghosts that lost it.
1477 // Only on an actual capture, not while the workshop is merely contested (neutral).
1480 }
1481 }
WGWorkshopData const WorkshopsData[WG_MAX_WORKSHOP]
Definition BattlefieldWG.h:1037
@ BATTLEFIELD_WG_OBJECTSTATE_NEUTRAL_INTACT
Definition BattlefieldWG.h:483
@ BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT
Definition BattlefieldWG.h:489
@ BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT
Definition BattlefieldWG.h:486
@ TEAM_ALLIANCE
Definition SharedDefines.h:748
@ TEAM_HORDE
Definition SharedDefines.h:749
void UpdateCounterVehicle(bool init)
Vehicle world states update.
Definition BattlefieldWG.cpp:321
uint32 GetAreaByGraveyardId(uint8 gId) const
Definition BattlefieldWG.cpp:567
void RelocateDeadPlayers(uint8 graveyardId, TeamId newOwner)
Definition BattlefieldWG.cpp:584
void CapturePointTaken(uint32 areaId)
Definition BattlefieldWG.cpp:359
void SendWarning(uint8 id, WorldObject const *target=nullptr)
Definition Battlefield.cpp:543
BfGraveyard * GetGraveyardById(uint32 id) const
Definition Battlefield.cpp:671
void SendUpdateWorldState(uint32 field, uint32 value)
Update data of a worldstate to all players present in zone.
Definition Battlefield.cpp:549
void GiveControlTo(TeamId team)
Definition Battlefield.cpp:773
bool IsCapturable() const
Definition BattlefieldWG.h:1426

References WGWorkshopData::attackText, BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT, BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT, BATTLEFIELD_WG_OBJECTSTATE_NEUTRAL_INTACT, bf, BattlefieldWG::CapturePointTaken(), BattlefieldWG::GetAreaByGraveyardId(), Battlefield::GetGraveyardById(), BfGraveyard::GiveControlTo(), IsCapturable(), BattlefieldWG::RelocateDeadPlayers(), Battlefield::SendUpdateWorldState(), Battlefield::SendWarning(), state, WGWorkshopData::takenText, TEAM_ALLIANCE, TEAM_HORDE, TEAM_NEUTRAL, teamControl, BattlefieldWG::UpdateCounterVehicle(), workshopId, and WorkshopsData.

Referenced by WintergraspCapturePoint::ChangeTeam(), BattlefieldWG::SetupBattlefield(), and UpdateGraveyardAndWorkshop().

◆ IsCapturable()

bool WGWorkshop::IsCapturable ( ) const
inline
uint8 const WG_CAPTURE_WORKSHOP_COUNT
Definition BattlefieldWG.h:1028

References WG_CAPTURE_WORKSHOP_COUNT, and workshopId.

Referenced by GiveControlTo(), and UpdateGraveyardAndWorkshop().

◆ Save()

void WGWorkshop::Save ( )
inline
1492 {
1493 sWorldState->setWorldState(WorkshopsData[workshopId].worldstate, state);
1494 }
#define sWorldState
Definition WorldState.h:377

References state, sWorldState, workshopId, and WorkshopsData.

◆ UpdateGraveyardAndWorkshop()

void WGWorkshop::UpdateGraveyardAndWorkshop ( )
inline
1484 {
1485 if (IsCapturable())
1487 else
1489 }
TeamId
Definition SharedDefines.h:747
TeamId GetDefenderTeam() const
Definition Battlefield.h:267
void GiveControlTo(TeamId team, bool init)
Definition BattlefieldWG.h:1428

References bf, Battlefield::GetDefenderTeam(), Battlefield::GetGraveyardById(), BfGraveyard::GiveControlTo(), GiveControlTo(), IsCapturable(), teamControl, and workshopId.

Member Data Documentation

◆ bf

◆ state

uint32 WGWorkshop::state

Referenced by GiveControlTo(), Save(), and WGWorkshop().

◆ teamControl

TeamId WGWorkshop::teamControl

◆ workshopId


The documentation for this struct was generated from the following file: