Add TypeChecker and use its methods wherever possible.

This commit is contained in:
László Monda
2016-03-30 01:59:05 +02:00
parent 94e5d55d8f
commit 0edde3236a
7 changed files with 18 additions and 20 deletions

View File

@@ -0,0 +1,13 @@
class TypeChecker {
static firstValidScancode = 1;
static lastValidScancode = 231;
static isUInt8Valid(uint8: number): boolean {
return 0 <= uint8 && uint8 <= 255;
}
static isScancodeValid(scancode: number): boolean {
return TypeChecker.firstValidScancode <= scancode && scancode <= TypeChecker.lastValidScancode;
}
}