DynRPG v0.32 Unofficial
Plugin SDK
Public Member Functions | Public Attributes | List of all members
RPG::DArray< T, base_, resizeValue > Class Template Reference

#include <DArray.h>

Public Member Functions

int base ()
 Returns the base of the array (zero in most cases)
 
Toperator[] (int index)
 Array access operator.
 
void resize (int newSize)
 Resizes the array.
 

Public Attributes

int size
 Size of the array.
 
Titems
 Pointer to array items.
 

Detailed Description

template<class T = void*, int base_ = 0, int resizeValue = 0>
class RPG::DArray< T, base_, resizeValue >

Array class

Parameters
resizeValueWhen a DArray is resized larger than its current size, this is the value to assign to the new items. Currently used only for DBActor::conditions, DBActor::attributes, DBClass::conditions, DBClass::attributes, DBMonster::conditions & DBMonster::attributes

Member Function Documentation

◆ operator[]()

template<class T = void*, int base_ = 0, int resizeValue = 0>
T & RPG::DArray< T, base_, resizeValue >::operator[] ( int index)
inline

Array access operator.

Note
This operator will throw an error if you try to access negative indexes. However, if you use an index which is higher than the current maximum, the array is resized.

◆ resize()

template<class T = void*, int base_ = 0, int resizeValue = 0>
void RPG::DArray< T, base_, resizeValue >::resize ( int newSize)
inline

Resizes the array.

New elements will be initialized with zero.

Parameters
newSizeThe new number of elements in the array

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