Checksum code fixed. Added DocBlocks to D2Classes. TODO: Fill in docblocks, refactor, code cleanup

This commit is contained in:
Hash Borgir
2022-07-06 17:41:24 -06:00
parent f3b24de2a8
commit eb28039f88
28 changed files with 1285 additions and 340 deletions

View File

@@ -42,8 +42,14 @@
*/
/**
*
*/
class D2DocGenerator {
/**
*
*/
public function __construct() {
require_once './config.php';
require_once './_pdo.php';
@@ -61,6 +67,9 @@ class D2DocGenerator {
$idata = new D2ItemData();
}
/**
* @return array
*/
public function getIscProps() {
$sql = "
SELECT p.`code` as prop,
@@ -103,6 +112,9 @@ class D2DocGenerator {
return $isc;
}
/**
* @return array
*/
public function getStrings() {
// load strings
$sql = 'SELECT * FROM strings';
@@ -110,6 +122,9 @@ class D2DocGenerator {
return $strings;
}
/**
* @return array
*/
public function getItemTypesTbl() {
// load itemtypes table in memory
$sql = "SELECT ItemType,Code FROM itemtypes";
@@ -118,6 +133,9 @@ class D2DocGenerator {
return $itemtypesTbl;
}
/**
* @return array
*/
public function getNameStr() {
// load namestr from 3 files
$sql = "SELECT code,namestr FROM armor
@@ -130,6 +148,10 @@ class D2DocGenerator {
return $namestr;
}
/**
* @param $code
* @return string
*/
public function getImage($code) {
$sql = "SELECT invfile FROM armor WHERE `code`=\"$code\" OR `type`=\"$code\" OR `type2`=\"$code\"";
$img = PDO_FetchOne($sql);
@@ -144,6 +166,10 @@ class D2DocGenerator {
return $img = (!empty($img)) ? "$img.png" : "1.png";
}
/**
* @param $code
* @return false
*/
public function getItemName($code) {
$sql = "SELECT name FROM armor WHERE `code`=\"$code\" OR `type`=\"$code\" OR `type2`=\"$code\"";
$name = PDO_FetchOne($sql);
@@ -158,6 +184,9 @@ class D2DocGenerator {
return $name;
}
/**
* @return void
*/
public function generateDocs() {
}