Tracker made in React for keeping track of HP and MP and so on.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
791 B

import {Character, CharacterId} from "./Character";
export interface Clock {}
export interface SessionState {
readonly fpUsed: number
readonly upUsed: number
}
export interface ConflictState {
readonly round: number|null
readonly activeSideIsAllies: boolean
readonly activeCharacterId: string|null
readonly timeoutAt: number|null
}
export interface GameState {
readonly session: SessionState
readonly conflict?: ConflictState
readonly clocks: readonly Clock[]
readonly characters: readonly Character[]
// TODO: add "status definitions" and have character statuses reference them
}
export function getCharacterById(state: GameState, id: CharacterId): Character|undefined {
return state.characters.find((character) => character.id === id)
}