Make test-serializer.ts serialize and deserialize the configuration.
This commit is contained in:
@@ -20,7 +20,7 @@ class KeyActions implements Serializable<KeyActions> {
|
||||
toJsObject(): any {
|
||||
let array = [];
|
||||
for (let keyAction of this.keyActions) {
|
||||
keyAction.toJsObject();
|
||||
array.push(keyAction.toJsObject());
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
class NoneAction extends KeyAction implements Serializable<NoneAction> {
|
||||
|
||||
static noneActionParam = 0;
|
||||
|
||||
fromJsObject(jsObject: any): NoneAction {
|
||||
this.assertKeyActionType(jsObject, KeyActionType.NoneAction, 'NoneAction');
|
||||
return this;
|
||||
@@ -9,12 +7,6 @@ class NoneAction extends KeyAction implements Serializable<NoneAction> {
|
||||
|
||||
fromBinary(buffer: UhkBuffer): NoneAction {
|
||||
this.readAndAssertKeyActionId(buffer, KeyActionId.NoneAction, 'NoneAction');
|
||||
|
||||
let keyActionParam = buffer.readUInt8();
|
||||
if (keyActionParam !== NoneAction.noneActionParam) {
|
||||
throw `Invalid NoneAction.param: ${keyActionParam}`;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user