move bin<->bool conversion to UhkBuffer

This commit is contained in:
Sam Rang
2016-04-18 20:00:27 -05:00
parent 0c53b49c6a
commit 634aa6c532
5 changed files with 16 additions and 18 deletions
@@ -21,7 +21,7 @@ class SwitchLayerAction extends KeyAction {
_fromBinary(buffer: UhkBuffer): SwitchLayerAction {
this.readAndAssertKeyActionId(buffer);
this.layer = buffer.readUInt8();
this.isLayerToggleable = this.binToBool(buffer.readUInt8());
this.isLayerToggleable = buffer.readBoolean();
return this;
}
@@ -36,7 +36,7 @@ class SwitchLayerAction extends KeyAction {
_toBinary(buffer: UhkBuffer) {
buffer.writeUInt8(KeyActionId.SwitchLayerAction);
buffer.writeUInt8(this.layer);
buffer.writeUInt8(this.boolToBin(this.isLayerToggleable));
buffer.writeBoolean(this.isLayerToggleable);
}
toString(): string {