Skip to content

Commit

Permalink
refactor: use self
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Aug 6, 2023
1 parent 901f9f9 commit 16ef54e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,14 +602,17 @@ export default class Game {

this.activeCreature = this.players[0].creatures[0]; // Prevent errors

this.UI = new UI(
{
get isAcceptingInput() {
return !this.freezedInput;
{
const self = this;
this.UI = new UI(
{
get isAcceptingInput() {
return !self.freezedInput;
},
},
},
this,
); // Create UI (not before because some functions require creatures to already exist)
this,
); // Create UI (not before because some functions require creatures to already exist)
}

// DO NOT CALL LOG BEFORE UI CREATION
this.gameState = 'playing';
Expand Down

0 comments on commit 16ef54e

Please sign in to comment.