TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GameTable< T > Class Template Reference

#include <DBCStores.h>

Public Member Functions

 GameTable (char const *format)
 
void SetGameTableEntry (GameTablesEntry const *gtEntry)
 
T constEvaluateTable (uint32 row, uint32 column) const
 
char constGetFormat () const
 
uint32 GetFieldCount () const
 
bool Load (char const *fileName)
 
uint32 GetTableRowCount () const
 
uint32 GetTableColumnCount () const
 

Private Attributes

DBCStorage< T > _storage
 
GameTablesEntry const_gtEntry
 

Constructor & Destructor Documentation

template<class T>
GameTable< T >::GameTable ( char const format)
inline
103 : _storage(format), _gtEntry(nullptr) { }
void format(BasicFormatter< Char > &f, const Char *&format_str, const T &value)
Definition: format.h:2963
GameTablesEntry const * _gtEntry
Definition: DBCStores.h:124
DBCStorage< T > _storage
Definition: DBCStores.h:123

Member Function Documentation

template<class T>
T const* GameTable< T >::EvaluateTable ( uint32  row,
uint32  column 
) const
inline
108  {
109  ASSERT(row < _gtEntry->NumRows, "Requested row %u from GameTable %s but there are only %u rows!", row, _gtEntry->Name->Str[0], _gtEntry->NumRows);
110  ASSERT(column < _gtEntry->NumColumns, "Requested column %u from GameTable %s but there are only %u columns!", column, _gtEntry->Name->Str[0], _gtEntry->NumColumns);
111 
112  return _storage.LookupEntry(_gtEntry->NumRows * column + row);
113  }
LocalizedString * Name
Definition: DB2Structure.h:422
char const * Str[TOTAL_LOCALES]
Definition: Common.h:148
uint32 NumRows
Definition: DB2Structure.h:423
GameTablesEntry const * _gtEntry
Definition: DBCStores.h:124
uint32 NumColumns
Definition: DB2Structure.h:424
#define ASSERT
Definition: Errors.h:55
DBCStorage< T > _storage
Definition: DBCStores.h:123
template<class T>
uint32 GameTable< T >::GetFieldCount ( ) const
inline
116 { return _storage.GetFieldCount(); }
DBCStorage< T > _storage
Definition: DBCStores.h:123

+ Here is the caller graph for this function:

template<class T>
char const* GameTable< T >::GetFormat ( ) const
inline
115 { return _storage.GetFormat(); }
DBCStorage< T > _storage
Definition: DBCStores.h:123

+ Here is the caller graph for this function:

template<class T>
uint32 GameTable< T >::GetTableColumnCount ( ) const
inline
120 { return _gtEntry->NumColumns; }
GameTablesEntry const * _gtEntry
Definition: DBCStores.h:124
uint32 NumColumns
Definition: DB2Structure.h:424
template<class T>
uint32 GameTable< T >::GetTableRowCount ( ) const
inline
119 { return _gtEntry->NumRows; }
uint32 NumRows
Definition: DB2Structure.h:423
GameTablesEntry const * _gtEntry
Definition: DBCStores.h:124
template<class T>
bool GameTable< T >::Load ( char const fileName)
inline
117 { return _storage.Load(fileName, nullptr); }
DBCStorage< T > _storage
Definition: DBCStores.h:123

+ Here is the caller graph for this function:

template<class T>
void GameTable< T >::SetGameTableEntry ( GameTablesEntry const gtEntry)
inline
105 { _gtEntry = gtEntry; }
GameTablesEntry const * _gtEntry
Definition: DBCStores.h:124

+ Here is the caller graph for this function:

Member Data Documentation

template<class T>
GameTablesEntry const* GameTable< T >::_gtEntry
private
template<class T>
DBCStorage<T> GameTable< T >::_storage
private

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