That's a spicy meatball
* APIUtils additions * Socket and web server listen on dedicated ports (see denoland/deno socket issue created by ZombieB1309 on GitHub) * Coach and Server created automatically (untested) * Profile content functions split into 'managers' * Progression temporary implementation * Settings placed into profile content manager * Relationships and messages return temporary empty array * Socket targets defined, message delivery to target, exec returned (goes unused for now)
This commit is contained in:
35
src/data/profile/progression.ts
Normal file
35
src/data/profile/progression.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { Config } from "../../config.ts";
|
||||
import { GameConfigs } from "../config.ts";
|
||||
import { ProfileContentManager } from "./profilemanagerbase.ts";
|
||||
|
||||
const serverConfig = Config.getConfig();
|
||||
const config = GameConfigs.getConfig();
|
||||
/**
|
||||
* Level -> Required XP
|
||||
*/
|
||||
const requiredXpMap: Map<number, number> = new Map();
|
||||
|
||||
export class ProfileProgressionManager extends ProfileContentManager {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
// fill `requiredXpMap` using `config.public` values
|
||||
}
|
||||
|
||||
#getRequiredXp(level: number) {
|
||||
if (level > serverConfig.public.maxLevels) return null;
|
||||
else {
|
||||
const req = requiredXpMap.get(level);
|
||||
return req ? req : null;
|
||||
}
|
||||
}
|
||||
|
||||
getLevel() {
|
||||
return 30; // temporary
|
||||
}
|
||||
|
||||
getXp() {
|
||||
return 0; // temporary
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user