-
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.
refactored splits to support live mode and animation can now follow l…
…ive mode, without it canceling playback
- Loading branch information
1 parent
195e419
commit ba841f8
Showing
17 changed files
with
574 additions
and
371 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,5 @@ | |
".*Class", | ||
".*ClassName" | ||
], | ||
"cSpell.words": ["Arrayish"] | ||
"cSpell.words": ["Arrayish", "inperformant"] | ||
} |
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
50 changes: 37 additions & 13 deletions
50
src/lib/parser/recording-files/events/player-data-event.ts
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 |
---|---|---|
@@ -1,20 +1,44 @@ | ||
import { type PlayerDataField, type PlayerDataFieldValue } from '../../player-data/player-data'; | ||
import { AbilityOrItemField, isPlayerDataAbilityOrItemField } from '../../player-data/abilities'; | ||
import { | ||
isPlayerDataDefeatedField, | ||
isPlayerDataKilledField, | ||
PlayerDataDefeatedField, | ||
PlayerDataKilledField, | ||
type PlayerDataField, | ||
type PlayerDataFieldValue, | ||
} from '../../player-data/player-data'; | ||
import { type PlayerPositionEvent } from './player-position-event'; | ||
import { RecordingEventBase, type RecordingEventBaseOptions } from './recording-event-base'; | ||
|
||
export type PlayerDataEventOptions<TField extends PlayerDataField> = RecordingEventBaseOptions & | ||
Pick<PlayerDataEvent<TField>, 'field' | 'value' | 'previousPlayerPositionEvent' | 'previousPlayerDataEventOfField'>; | ||
Pick<PlayerDataEvent<TField>, 'field' | 'value' | 'previousPlayerPositionEvent' | 'previousPlayerDataEventOfField'>; | ||
export class PlayerDataEvent<TField extends PlayerDataField> extends RecordingEventBase { | ||
public previousPlayerPositionEvent: PlayerPositionEvent | null; | ||
public previousPlayerDataEventOfField: PlayerDataEvent<TField> | null; | ||
public field: TField; | ||
public value: PlayerDataFieldValue<TField>; | ||
public previousPlayerPositionEvent: PlayerPositionEvent | null; | ||
public previousPlayerDataEventOfField: PlayerDataEvent<TField> | null; | ||
public field: TField; | ||
public value: PlayerDataFieldValue<TField>; | ||
|
||
constructor(options: PlayerDataEventOptions<TField>) { | ||
super(options); | ||
this.previousPlayerPositionEvent = options.previousPlayerPositionEvent; | ||
this.field = options.field; | ||
this.value = options.value; | ||
this.previousPlayerDataEventOfField = options.previousPlayerDataEventOfField; | ||
} | ||
constructor(options: PlayerDataEventOptions<TField>) { | ||
super(options); | ||
this.previousPlayerPositionEvent = options.previousPlayerPositionEvent; | ||
this.field = options.field; | ||
this.value = options.value; | ||
this.previousPlayerDataEventOfField = options.previousPlayerDataEventOfField; | ||
} | ||
|
||
public isOfField<TFieldCheck extends PlayerDataField>(field: TFieldCheck): this is PlayerDataEvent<TFieldCheck> { | ||
return (this.field as unknown) === field; | ||
} | ||
|
||
public isOfDefeatedField(): this is PlayerDataEvent<PlayerDataDefeatedField> { | ||
return isPlayerDataDefeatedField(this.field); | ||
} | ||
|
||
public isOfKilledField(): this is PlayerDataEvent<PlayerDataKilledField> { | ||
return isPlayerDataKilledField(this.field); | ||
} | ||
|
||
public isOfAbilityOrItemField(): this is PlayerDataEvent<AbilityOrItemField> { | ||
return isPlayerDataAbilityOrItemField(this.field); | ||
} | ||
} |
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
Oops, something went wrong.