mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 16:34:23 -05:00
Checksum code fixed. Added DocBlocks to D2Classes. TODO: Fill in docblocks, refactor, code cleanup
This commit is contained in:
@@ -41,20 +41,41 @@
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class D2TxtParser {
|
||||
|
||||
public $path = TXT_PATH;
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
public $path = TXT_PATH;
|
||||
|
||||
public $db;
|
||||
|
||||
public function __construct() {
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
public $db;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
public function parseFile($file) {
|
||||
/**
|
||||
* @param $file
|
||||
* @return array
|
||||
*/
|
||||
public function parseFile($file) {
|
||||
return $this->parseData($file);
|
||||
}
|
||||
|
||||
function filterProps($file) {
|
||||
/**
|
||||
* @param $file
|
||||
* @return array
|
||||
*/
|
||||
function filterProps($file) {
|
||||
$data = $this->parseData($file);
|
||||
$propsToFilter = file(FILTER_PROPERTIES_FILE, FILE_IGNORE_NEW_LINES);
|
||||
foreach ($data as $d) {
|
||||
@@ -65,7 +86,11 @@ class D2TxtParser {
|
||||
return $filteredProps;
|
||||
}
|
||||
|
||||
public function parseData($file) {
|
||||
/**
|
||||
* @param $file
|
||||
* @return array
|
||||
*/
|
||||
public function parseData($file) {
|
||||
$file = $this->path . $file;
|
||||
$rows = array_map(function ($v) {
|
||||
return str_getcsv($v, "\t");
|
||||
|
Reference in New Issue
Block a user