pokerogue/src/system/trainer-data.ts

18 lines
588 B
TypeScript
Raw Normal View History

2023-10-07 16:08:33 -04:00
import BattleScene from "../battle-scene";
import { TrainerType } from "../data/trainer-type";
import Trainer from "../trainer";
export default class TrainerData {
public trainerType: TrainerType;
public female: boolean;
constructor(source: Trainer | any) {
const sourceTrainer = source instanceof Trainer ? source as Trainer : null;
this.trainerType = sourceTrainer ? sourceTrainer.config.trainerType : source.trainerType;
this.female = source.female;
}
toTrainer(scene: BattleScene): Trainer {
return new Trainer(scene, this.trainerType, this.female);
}
}