Add tests
This commit is contained in:
parent
d0265ad90e
commit
b6db7e8dc7
1 changed files with 494 additions and 109 deletions
|
|
@ -1,9 +1,11 @@
|
|||
import { OptionsHandler } from './options-handler';
|
||||
|
||||
export abstract class VibrationHandler {
|
||||
public static vibrate(time: number): void {
|
||||
// Accepts either a single duration or an on/off pattern (e.g. a double-thump
|
||||
// [40, 30, 90] for a kill).
|
||||
public static vibrate(pattern: number | number[]): void {
|
||||
if (OptionsHandler.options.vibrationEnabled && this.isVibrationEnabled) {
|
||||
navigator.vibrate(time);
|
||||
navigator.vibrate(pattern);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue