aboutsummaryrefslogtreecommitdiff
path: root/src/lib/models/Level.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/models/Level.ts')
-rw-r--r--src/lib/models/Level.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/models/Level.ts b/src/lib/models/Level.ts
new file mode 100644
index 0000000..bce9aa4
--- /dev/null
+++ b/src/lib/models/Level.ts
@@ -0,0 +1,21 @@
+import { Optional } from 'sequelize/types';
+import { BaseModel } from './BaseModel';
+
+export interface LevelModel {
+ id: string;
+ xp: number;
+}
+
+export type LevelModelCreationAttributes = Optional<LevelModel, 'xp'>;
+
+export class Level extends BaseModel<LevelModel, LevelModelCreationAttributes> {
+ public id: string;
+ public xp: number;
+ get level(): number {
+ return Level.convertXpToLevel(this.xp);
+ }
+ static convertXpToLevel(xp: number): number {
+ // WIP
+ return 0;
+ }
+}