refactor the whole damn thing

This commit is contained in:
Kevin Jahns
2017-10-11 03:41:54 +02:00
parent d9ee67d2f3
commit 82015d5a37
43 changed files with 2194 additions and 4848 deletions

24
src/Struct/ItemString.js Normal file
View File

@@ -0,0 +1,24 @@
import Item from './Item'
export default class ItemString extends Item {
constructor () {
super()
this._content = null
}
get _length () {
return this._content.length
}
_fromBinary (y, decoder) {
let missing = super._fromBinary(y, decoder)
this._content = decoder.readVarString()
return missing
}
_toBinary (y, encoder) {
super._toBinary(y, encoder)
encoder.writeVarString(this._content)
}
_logString () {
let s = super._logString()
return 'ItemString: ' + s
}
}