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)
 
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
1437 {
1438 ASSERT(_bf || _workshopId < WG_MAX_WORKSHOP);
1439
1440 bf = _bf;
1441 workshopId = _workshopId;
1444 }
uint8 const WG_MAX_WORKSHOP
Definition BattlefieldWG.h:1042
@ BATTLEFIELD_WG_OBJECTSTATE_NONE
Definition BattlefieldWG.h:490
#define ASSERT
Definition Errors.h:68
@ TEAM_NEUTRAL
Definition SharedDefines.h:762
TeamId teamControl
Definition BattlefieldWG.h:1432
uint32 state
Definition BattlefieldWG.h:1434
uint8 workshopId
Definition BattlefieldWG.h:1430
BattlefieldWG * bf
Definition BattlefieldWG.h:1428

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
1447 {
1448 switch (team)
1449 {
1450 case TEAM_NEUTRAL:
1451 {
1452 // Send warning message to all player to inform a faction attack to a workshop
1453 // alliance / horde attacking a workshop
1454 bf->SendWarning(teamControl ? WorkshopsData[workshopId].attackText : (WorkshopsData[workshopId].attackText + 2));
1455
1456 // Updating worldstate, update icon to neutral
1459
1460 // Found associate graveyard and update it
1464
1465 teamControl = team;
1466 break;
1467 }
1468 case TEAM_ALLIANCE:
1469 case TEAM_HORDE:
1470 {
1471 // Updating worldstate
1474
1475 // Warning message
1476 if (!init) // workshop taken - alliance
1477 bf->SendWarning(team == TEAM_ALLIANCE ? WorkshopsData[workshopId].takenText : (WorkshopsData[workshopId].takenText + 2));
1478
1479 // Found associate graveyard and update it
1483
1484 teamControl = team;
1485 break;
1486 }
1487 }
1488
1489 if (!init)
1490 {
1491 bf->UpdateCounterVehicle(false);
1493 }
1494 }
WGWorkshopData const WorkshopsData[WG_MAX_WORKSHOP]
Definition BattlefieldWG.h:1052
@ BATTLEFIELD_WG_OBJECTSTATE_NEUTRAL_INTACT
Definition BattlefieldWG.h:491
@ BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT
Definition BattlefieldWG.h:497
@ BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT
Definition BattlefieldWG.h:494
@ BATTLEFIELD_WG_WORKSHOP_KEEP_WEST
Definition BattlefieldWG.h:508
@ TEAM_ALLIANCE
Definition SharedDefines.h:760
@ TEAM_HORDE
Definition SharedDefines.h:761
void UpdateCounterVehicle(bool init)
Vehicle world states update.
Definition BattlefieldWG.cpp:300
uint32 GetAreaByGraveyardId(uint8 gId) const
Definition BattlefieldWG.cpp:542
void CapturePointTaken(uint32 areaId)
Definition BattlefieldWG.cpp:338
void SendWarning(uint8 id, WorldObject const *target=nullptr)
Definition Battlefield.cpp:480
BfGraveyard * GetGraveyardById(uint32 id) const
Definition Battlefield.cpp:588
void SendUpdateWorldState(uint32 field, uint32 value)
Update data of a worldstate to all players present in zone.
Definition Battlefield.cpp:486
void GiveControlTo(TeamId team)
Definition Battlefield.cpp:753

References WGWorkshopData::attackText, BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT, BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT, BATTLEFIELD_WG_OBJECTSTATE_NEUTRAL_INTACT, BATTLEFIELD_WG_WORKSHOP_KEEP_WEST, bf, BattlefieldWG::CapturePointTaken(), BattlefieldWG::GetAreaByGraveyardId(), Battlefield::GetGraveyardById(), BfGraveyard::GiveControlTo(), 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().

◆ Save()

void WGWorkshop::Save ( )
inline
1505 {
1506 sWorld->setWorldState(WorkshopsData[workshopId].worldstate, state);
1507 }
#define sWorld
Definition World.h:363

References state, sWorld, workshopId, and WorkshopsData.

◆ UpdateGraveyardAndWorkshop()

void WGWorkshop::UpdateGraveyardAndWorkshop ( )
inline
1497 {
1500 else
1502 }
TeamId
Definition SharedDefines.h:759
TeamId GetDefenderTeam()
Definition Battlefield.h:275
void GiveControlTo(TeamId team, bool init)
Definition BattlefieldWG.h:1446

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

Member Data Documentation

◆ bf

◆ state

uint32 WGWorkshop::state

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

◆ teamControl

TeamId WGWorkshop::teamControl

◆ workshopId

uint8 WGWorkshop::workshopId

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