From 360f266864ab5825831399967f8bd1dc2946c356 Mon Sep 17 00:00:00 2001 From: Balte de Wit Date: Sat, 9 Jun 2018 09:26:25 +0200 Subject: [PATCH] fix: AbstractCommand works with static MaskFlags --- src/commands/AbstractCommand.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/commands/AbstractCommand.ts b/src/commands/AbstractCommand.ts index 34f6594a2..1d6ed46f5 100644 --- a/src/commands/AbstractCommand.ts +++ b/src/commands/AbstractCommand.ts @@ -1,9 +1,9 @@ import { AtemState } from '../state' export default abstract class AbstractCommand { + static MaskFlags?: { [key: string]: number } abstract rawName: string packetId: number - MaskFlags?: { [key: string]: number } flag: number = 0 resolve: (cmd: AbstractCommand) => void @@ -24,11 +24,12 @@ export default abstract class AbstractCommand { ...this.properties, ...newProps } + const maskFlags = (this.constructor as any).MaskFlags as { [key: string]: number } - if (this.MaskFlags) { + if (maskFlags) { for (const key in newProps) { - if (key in this.MaskFlags) { - this.flag = this.flag | this.MaskFlags[key] + if (key in maskFlags) { + this.flag = this.flag | maskFlags[key] } } }