diff options
author | TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> | 2021-05-11 22:55:26 -0600 |
---|---|---|
committer | TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> | 2021-05-11 22:55:26 -0600 |
commit | 3cd8db5ebc83fd31dd831605bc347dedbc2f9367 (patch) | |
tree | cd6d710f7effb1d75ec48edf52d460da7a34a9eb /src/lib/models/Level.ts | |
parent | 31764f52541a0566f148fb70c1a0e02c99bb5099 (diff) | |
download | tanzanite-3cd8db5ebc83fd31dd831605bc347dedbc2f9367.tar.gz tanzanite-3cd8db5ebc83fd31dd831605bc347dedbc2f9367.tar.bz2 tanzanite-3cd8db5ebc83fd31dd831605bc347dedbc2f9367.zip |
set up db for leveling
Diffstat (limited to 'src/lib/models/Level.ts')
-rw-r--r-- | src/lib/models/Level.ts | 21 |
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; + } +} |