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
1412 {
1413 ASSERT(_bf || _workshopId < WG_MAX_WORKSHOP);
1414
1415 bf = _bf;
1416 workshopId = _workshopId;
1419 }
uint8 const WG_MAX_WORKSHOP
Definition BattlefieldWG.h:1018
@ BATTLEFIELD_WG_OBJECTSTATE_NONE
Definition BattlefieldWG.h:475
#define ASSERT
Definition Errors.h:68
@ TEAM_NEUTRAL
Definition SharedDefines.h:750
TeamId teamControl
Definition BattlefieldWG.h:1407
uint32 state
Definition BattlefieldWG.h:1409
uint8 workshopId
Definition BattlefieldWG.h:1405
BattlefieldWG * bf
Definition BattlefieldWG.h:1403

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
1422 {
1423 switch (team)
1424 {
1425 case TEAM_NEUTRAL:
1426 {
1427 // Send warning message to all player to inform a faction attack to a workshop
1428 // alliance / horde attacking a workshop
1429 bf->SendWarning(teamControl ? WorkshopsData[workshopId].attackText : (WorkshopsData[workshopId].attackText + 2));
1430
1431 // Updating worldstate, update icon to neutral
1434
1435 // Found associate graveyard and update it
1439
1440 teamControl = team;
1441 break;
1442 }
1443 case TEAM_ALLIANCE:
1444 case TEAM_HORDE:
1445 {
1446 // Updating worldstate
1449
1450 // Warning message
1451 if (!init) // workshop taken - alliance
1452 bf->SendWarning(team == TEAM_ALLIANCE ? WorkshopsData[workshopId].takenText : (WorkshopsData[workshopId].takenText + 2));
1453
1454 // Found associate graveyard and update it
1458
1459 teamControl = team;
1460 break;
1461 }
1462 }
1463
1464 if (!init)
1465 {
1466 bf->UpdateCounterVehicle(false);
1468 }
1469 }
WGWorkshopData const WorkshopsData[WG_MAX_WORKSHOP]
Definition BattlefieldWG.h:1028
@ BATTLEFIELD_WG_OBJECTSTATE_NEUTRAL_INTACT
Definition BattlefieldWG.h:476
@ BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT
Definition BattlefieldWG.h:482
@ BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT
Definition BattlefieldWG.h:479
@ BATTLEFIELD_WG_WORKSHOP_KEEP_WEST
Definition BattlefieldWG.h:493
@ TEAM_ALLIANCE
Definition SharedDefines.h:748
@ TEAM_HORDE
Definition SharedDefines.h:749
void UpdateCounterVehicle(bool init)
Vehicle world states update.
Definition BattlefieldWG.cpp:301
uint32 GetAreaByGraveyardId(uint8 gId) const
Definition BattlefieldWG.cpp:539
void CapturePointTaken(uint32 areaId)
Definition BattlefieldWG.cpp:339
void SendWarning(uint8 id, WorldObject const *target=nullptr)
Definition Battlefield.cpp:456
BfGraveyard * GetGraveyardById(uint32 id) const
Definition Battlefield.cpp:549
void SendUpdateWorldState(uint32 field, uint32 value)
Update data of a worldstate to all players present in zone.
Definition Battlefield.cpp:462
void GiveControlTo(TeamId team)
Definition Battlefield.cpp:712

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
1480 {
1481 sWorldState->setWorldState(WorkshopsData[workshopId].worldstate, state);
1482 }
#define sWorldState
Definition WorldState.h:377

References state, sWorldState, workshopId, and WorkshopsData.

◆ UpdateGraveyardAndWorkshop()

void WGWorkshop::UpdateGraveyardAndWorkshop ( )
inline
1472 {
1475 else
1477 }
TeamId
Definition SharedDefines.h:747
TeamId GetDefenderTeam() const
Definition Battlefield.h:279
void GiveControlTo(TeamId team, bool init)
Definition BattlefieldWG.h:1421

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: