refactor: use subclasses for different actor types
This commit is contained in:
parent
21f849b464
commit
be616e3be8
23 changed files with 321 additions and 240 deletions
56
src/actor/character/character-data-source.ts
Normal file
56
src/actor/character/character-data-source.ts
Normal file
|
@ -0,0 +1,56 @@
|
|||
// SPDX-FileCopyrightText: 2022 Johannes Loher
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { UsableResource } from "../../common/common-data";
|
||||
import { DS4ActorDataSourceDataBase } from "../actor-data-source-base";
|
||||
|
||||
export interface DS4CharacterDataSource {
|
||||
type: "character";
|
||||
data: DS4CharacterDataSourceData;
|
||||
}
|
||||
|
||||
interface DS4CharacterDataSourceData extends DS4ActorDataSourceDataBase {
|
||||
baseInfo: DS4CharacterDataSourceDataBaseInfo;
|
||||
progression: DS4CharacterDataSourceDataProgression;
|
||||
profile: DS4CharacterDataSourceDataProfile;
|
||||
currency: DS4CharacterDataSourceDataCurrency;
|
||||
slayerPoints: DS4CharacterDataSourceDataSlayerPoints;
|
||||
}
|
||||
|
||||
export interface DS4CharacterDataSourceDataBaseInfo {
|
||||
race: string;
|
||||
class: string;
|
||||
heroClass: string;
|
||||
culture: string;
|
||||
}
|
||||
|
||||
export interface DS4CharacterDataSourceDataProgression {
|
||||
level: number;
|
||||
experiencePoints: number;
|
||||
talentPoints: UsableResource<number>;
|
||||
progressPoints: UsableResource<number>;
|
||||
}
|
||||
|
||||
export interface DS4CharacterDataSourceDataProfile {
|
||||
biography: string;
|
||||
gender: string;
|
||||
birthday: string;
|
||||
birthplace: string;
|
||||
age: number;
|
||||
height: number;
|
||||
hairColor: string;
|
||||
weight: number;
|
||||
eyeColor: string;
|
||||
specialCharacteristics: string;
|
||||
}
|
||||
|
||||
export interface DS4CharacterDataSourceDataCurrency {
|
||||
gold: number;
|
||||
silver: number;
|
||||
copper: number;
|
||||
}
|
||||
|
||||
export interface DS4CharacterDataSourceDataSlayerPoints {
|
||||
value: number;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue