Move the gist of KeyActions to UhkArray and rename it as ClassArray. Make KeyActions descend from ClassArray. Improve array buffer dumping.

This commit is contained in:
László Monda
2016-04-04 00:06:18 +02:00
parent 0a0eb4c718
commit 15b27271a0
7 changed files with 107 additions and 54 deletions

View File

@@ -1,6 +1,6 @@
class KeyActionFactory {
class KeyActionFactory implements SubclassFactory<KeyAction> {
static fromJsObject(jsObject: any): KeyAction {
fromJsObject(jsObject: any): KeyAction {
switch (jsObject.keyActionType) {
case KeyActionType.NoneAction:
return new NoneAction().fromJsObject(jsObject);
@@ -23,7 +23,7 @@ class KeyActionFactory {
}
}
static fromBinary(buffer: UhkBuffer): KeyAction {
fromBinary(buffer: UhkBuffer): KeyAction {
let keyActionFirstByte = buffer.readUInt8();
buffer.backtrack();