-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make it work * clean it up * move event-handling to seperate class
- Loading branch information
1 parent
d484e05
commit 33c31bc
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class EventBroker { | ||
selectedEvents: number[] = [] | ||
|
||
addEvent(eventID: number):void { | ||
this.selectedEvents.push(eventID) | ||
} | ||
|
||
removeEvent(eventID: number): void { | ||
const index = this.selectedEvents.indexOf(eventID) | ||
if (index > -1) this.selectedEvents.splice(index, 1) | ||
} | ||
|
||
getEvents(): number[] { | ||
return this.selectedEvents | ||
} | ||
} | ||
|
||
export let eventBroker = new EventBroker() |