1.1.5 • Published 8 years ago

d2js v1.1.5

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

d2js NPM version Build Status Dependency Status Coverage percentage

common lib for dofus 2.0

Installation

$ npm install --save d2js

Usage

var d2js = require('d2js') // :: es5
// or import {D2I, D2O} from 'd2js' :: es6
d2js.D2I.register({key: 'file1', path: 'file1.d2i'}, {key: 'file2', path: 'file2.d2i'} [,...]) // I18nFileAccessor
d2js.D2O.register({key: 'file1', path: 'file1.d2o'}, {key: 'file2', path: 'file2.d2o'} [,...]) // GameDataFileAccessor

console.log(D2O.getObjects('file1', null, 5)); // display objects limit 5

Classes

Members

Functions

GameDataFileAccessor

Kind: global class
Export:

new GameDataFileAccessor()

Allow user to read d2o files

I18nFileAccessor

Kind: global class
Export:

new I18nFileAccessor()

Allow user to read d2i files

name

name getter

Kind: global variable

name

name setter

Kind: global variable

register()

Register all d2o files

Kind: global function

getClassDefinition(key, idx) ⇒ Object

Get class definition by index

Kind: global function

ParamType
keystring
idxnumber

getlength(key) ⇒ number

Get d2o items length

Kind: global function

ParamType
keystring

getObject(key, idx) ⇒ Object

Get object by index

Kind: global function

ParamType
keystring
idxnumber

getObjects(key, filter, limit, map) ⇒ Array.<Object>

Get objects from d2o file

Kind: global function

ParamTypeDefault
keystirng
filterfunction
limitnumber0
mapfunction

map(key, cb) ⇒ Array.<Object>

Mapping of objects as you wanted

Kind: global function

ParamType
keystring
cbfunction

register(...entry)

Register d2i files

Kind: global function

ParamTypeDescription
...entryObject
entry.keystringused when you call get methods
entry.pathstringfull path of d2i file

overrideId(key, idx1, idx2)

Override id

Kind: global function

ParamType
keystring
idx1number
idx2number

getOrderIndex(key, idx) ⇒ number

Get order index

Kind: global function

ParamType
keystring
idxnumber

getText(key, idx) ⇒ string

Get text

Kind: global function

ParamType
keystring
idxnumber

getUnDiacriticalText(key, idx) ⇒ string

Get undiacritical text

Kind: global function

ParamType
keystring
idxnumber

hasText(idx) ⇒ boolean

Verify if text exist

Kind: global function

ParamType
idxnumber

getNamedText(key, name) ⇒ string

Get named text

Kind: global function

ParamType
keystring
namestring

hasNamedText(key, name) ⇒ boolean

Verify if named text exists

Kind: global function

ParamType
keystring
namestring

useDirectBuffer(key, enableDirectBuffer)

Use direct buff

Kind: global function

ParamType
keystring
enableDirectBufferboolean

getTexts(key, filter) ⇒ Array

Get all text

Kind: global function

ParamType
keystring
filterfunction

License

MIT © Snapiz

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago