dsparser
v1.0.0
Published
This package implements Typescript Interfaces and functions for parsing raw WorldData for the Browsergame 'Die Stämme/TribalWars'
Downloads
2
Readme
DSParser Package
This package implements Typescript Interfaces and functions for parsing raw WorldData for the Browsergame 'Die Stämme/TribalWars'
Installation
This module is installed via npm:
npm install --save dsparser
Usage
Typescript
import dsparser from 'dsparser';
// put inside Async code because parsing is async
async function foo(worldName: string, data: string[]){
const parser = new dsparser(worldName);
// possible to parse in parallel but not recommended
await parser.parseVillage(data[0]);
await parser.parsePlayer(data[1]);
await parser.parseAlly(data[2]);
// call after parsePlayer()
await parser.parsePlayerKills(data[3], data[4], data[5], data[6]);
// call after parseAlly()
await parser.parseAllyKills(data[7], data[8], data[9]);
// Output data:
const player: IplayerDB[] = parser.getPlayerArray();
const ally: IallyDB[] = parser.getAllyArray();
}
### Interfaces
```ts
....
Note
This project was bootstrapped with TSDX.