MagicSchoolJs/src/model/student.ts

23 lines
515 B
TypeScript

import { Progress } from './progress';
import { school } from './school';
import { IUnit } from './unit';
import { makeAutoObservable } from 'mobx';
export class Student implements IUnit {
public progress = new Progress(10, 1, true, () => this.handleProgress());
constructor(
public readonly id: string,
public readonly name: string,
) {
makeAutoObservable(this);
}
private handleProgress(): boolean {
school.addReputation(0.1);
return true;
}
}