Files
aowow/includes/class.charclass.php
Sarjuuk 73cdce784e BaseTypes:
- rewrote BaseType::iterate() to be a generator and yield references (requires php 5.5)
- reduced usage of bandaid BaseType::reset()
- removed Util::getIdFieldName() which was even more of a bandaid
- discovered DBSimple::selectPage() and consequently removed $matchQuery as they are now obsoloete

Util:
- added trainerTemplate lists for future use with trainers and trained spells

misc. forgotten and/or broken stuff here and there
2013-08-20 20:45:24 +02:00

49 lines
1.4 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
class CharClassList extends BaseType
{
public static $type = TYPE_CLASS;
protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_classes WHERE [cond] ORDER BY Id ASC';
public function getListviewData()
{
$data = [];
foreach ($this->iterate() as $__)
{
$data[$this->id] = array(
'id' => $this->id,
'name' => $this->getField('name', true),
'races' => $this->curTpl['raceMask'],
'roles' => $this->curTpl['roles'],
'weapon' => $this->curTpl['weaponTypeMask'],
'armor' => $this->curTpl['armorTypeMask'],
'power' => $this->curTpl['powerType'],
);
if ($this->curTpl['expansion'] == 2) // todo (low): grr, move to db
$data[$this->id]['hero'] = 1;
if ($this->curTpl['expansion'])
$data[$this->id]['expansion'] = $this->curTpl['expansion'];
}
return $data;
}
public function addGlobalsToJscript(&$template, $addMask = 0)
{
foreach ($this->iterate() as $__)
$template->extendGlobalData(self::$type, [$this->id => ['name' => $this->getField('name', true)]]);
}
public function addRewardsToJScript(&$ref) { }
public function renderTooltip() { }
}
?>