updated eslint rules
This commit is contained in:
parent
1d7cc7ec9b
commit
0df44e3e87
|
@ -10,6 +10,12 @@ module.exports = {
|
|||
'@typescript-eslint/triple-slash-reference': 0,
|
||||
'@typescript-eslint/no-unused-vars': 0,
|
||||
'@typescript-eslint/no-explicit-any': 0,
|
||||
'@typescript-eslint/ban-ts-comment': 0
|
||||
'@typescript-eslint/ban-ts-comment': 0,
|
||||
'@typescript-eslint/explicit-function-return-type': 1,
|
||||
'quotes': [2, 'single', {avoidEscape: true},],
|
||||
'no-extra-parens': 1,
|
||||
'consistent-return': 1,
|
||||
'no-eq-null': 1,
|
||||
'no-implicit-globals': 1
|
||||
}
|
||||
};
|
||||
|
|
|
@ -8,13 +8,13 @@ const cycleLength = 250;
|
|||
function gameLoop (state: GameState, renderer: IRenderer): void {
|
||||
// figure out how much actual time has passed
|
||||
const elapsedTime: number = globalStartTime > 0
|
||||
? (new Date()).getTime() - globalStartTime : 0;
|
||||
? new Date().getTime() - globalStartTime : 0;
|
||||
|
||||
state.advance(elapsedTime);
|
||||
renderer.render(state);
|
||||
|
||||
// run again in 1sec
|
||||
globalStartTime = (new Date()).getTime();
|
||||
globalStartTime = new Date().getTime();
|
||||
globalTimeout = setTimeout((): void =>
|
||||
gameLoop(state, renderer), cycleLength);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class GameState {
|
|||
}
|
||||
|
||||
public advance (time: number): void {
|
||||
this.now = (new Date()).getTime();
|
||||
this.now = new Date().getTime();
|
||||
|
||||
this._timeSinceSave += time;
|
||||
if (this._timeSinceSave >= this._timeBetweenSaves) {
|
||||
|
|
|
@ -15,6 +15,7 @@ class Pastor extends Job {
|
|||
public isUnlocked (state: GameState): boolean {
|
||||
if (this._isUnlocked) return true;
|
||||
this._isUnlocked = state.getResource('chrch').isUnlocked(state);
|
||||
return this._isUnlocked;
|
||||
}
|
||||
|
||||
public advanceAction (time: number, state: GameState): void {
|
||||
|
|
Reference in New Issue