TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FactionTemplateEntry Struct Reference

#include <DBCStructure.h>

Public Member Functions

bool IsFriendlyTo (FactionTemplateEntry const &entry) const
 
bool IsHostileTo (FactionTemplateEntry const &entry) const
 
bool IsHostileToPlayers () const
 
bool IsNeutralToAll () const
 
bool IsContestedGuardFaction () const
 

Public Attributes

uint32 ID
 
uint32 Faction
 
uint32 Flags
 
uint32 Mask
 
uint32 FriendMask
 
uint32 EnemyMask
 
uint32 Enemies [MAX_FACTION_RELATIONS]
 
uint32 Friends [MAX_FACTION_RELATIONS]
 

Member Function Documentation

bool FactionTemplateEntry::IsContestedGuardFaction ( ) const
inline
484 { return (Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; }
uint32 Flags
Definition: DBCStructure.h:437
Definition: DBCEnums.h:463
bool FactionTemplateEntry::IsFriendlyTo ( FactionTemplateEntry const entry) const
inline
447  {
448  if (ID == entry.ID)
449  return true;
450  if (entry.Faction)
451  {
452  for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
453  if (Enemies[i] == entry.Faction)
454  return false;
455  for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
456  if (Friends[i] == entry.Faction)
457  return true;
458  }
459  return (FriendMask & entry.Mask) || (Mask & entry.FriendMask);
460  }
uint32 Enemies[MAX_FACTION_RELATIONS]
Definition: DBCStructure.h:441
uint32 FriendMask
Definition: DBCStructure.h:439
uint32 Friends[MAX_FACTION_RELATIONS]
Definition: DBCStructure.h:442
#define MAX_FACTION_RELATIONS
Definition: DBCStructure.h:431
uint32 ID
Definition: DBCStructure.h:435
uint32 Mask
Definition: DBCStructure.h:438

+ Here is the caller graph for this function:

bool FactionTemplateEntry::IsHostileTo ( FactionTemplateEntry const entry) const
inline
462  {
463  if (ID == entry.ID)
464  return false;
465  if (entry.Faction)
466  {
467  for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
468  if (Enemies[i] == entry.Faction)
469  return true;
470  for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
471  if (Friends[i] == entry.Faction)
472  return false;
473  }
474  return (EnemyMask & entry.Mask) != 0;
475  }
uint32 Enemies[MAX_FACTION_RELATIONS]
Definition: DBCStructure.h:441
uint32 Friends[MAX_FACTION_RELATIONS]
Definition: DBCStructure.h:442
uint32 EnemyMask
Definition: DBCStructure.h:440
#define MAX_FACTION_RELATIONS
Definition: DBCStructure.h:431
uint32 ID
Definition: DBCStructure.h:435

+ Here is the caller graph for this function:

bool FactionTemplateEntry::IsHostileToPlayers ( ) const
inline
476 { return (EnemyMask & FACTION_MASK_PLAYER) !=0; }
uint32 EnemyMask
Definition: DBCStructure.h:440
Definition: DBCEnums.h:469

+ Here is the caller graph for this function:

bool FactionTemplateEntry::IsNeutralToAll ( ) const
inline
478  {
479  for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
480  if (Enemies[i] != 0)
481  return false;
482  return EnemyMask == 0 && FriendMask == 0;
483  }
uint32 Enemies[MAX_FACTION_RELATIONS]
Definition: DBCStructure.h:441
uint32 FriendMask
Definition: DBCStructure.h:439
uint32 EnemyMask
Definition: DBCStructure.h:440
#define MAX_FACTION_RELATIONS
Definition: DBCStructure.h:431

+ Here is the caller graph for this function:

Member Data Documentation

uint32 FactionTemplateEntry::Enemies[MAX_FACTION_RELATIONS]
uint32 FactionTemplateEntry::EnemyMask
uint32 FactionTemplateEntry::Faction
uint32 FactionTemplateEntry::Flags
uint32 FactionTemplateEntry::FriendMask
uint32 FactionTemplateEntry::Friends[MAX_FACTION_RELATIONS]
uint32 FactionTemplateEntry::ID
uint32 FactionTemplateEntry::Mask

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