Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
432 B
1
Indexable
Never
import Race from './Race';

class Elf extends Race {
  private _maxLifePoints: number;
  private static _elfInstances = 0;

  constructor(name: string, dexterity: number) {
    super(name, dexterity);
    this._maxLifePoints = 99;
    Elf._elfInstances += 1;
  }

  get maxLifePoints(): number {
    return this._maxLifePoints;
  }

  static createdRacesInstances(): number {
    return Elf._elfInstances;
  }
}

export default Elf;
Leave a Comment