1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- import { _decorator, Component, Node } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('jifenDataConfig')
- export class jifenDataConfig {
- private static _instance: jifenDataConfig | null = null;
- public static get Instance() {
- if (jifenDataConfig._instance === null){
- jifenDataConfig._instance = new jifenDataConfig();
- jifenDataConfig._instance.initData()
- }
- return jifenDataConfig._instance;
- }
- public level_config = new Map();
- getDataByLevel(integral_level):jifenData{
- if(integral_level>=13){
- integral_level = 13;
- }
- return jifenDataConfig.Instance.level_config.get(integral_level+"")
- }
- private initData(){
- let index_1 = new jifenData()
- index_1.name = "草民"
- index_1.score = -400
- jifenDataConfig._instance.level_config.set("1",index_1)
- let index_2 = new jifenData()
- index_2.name = "县丞"
- index_2.score = 50
- jifenDataConfig._instance.level_config.set("2",index_2)
- let index_3 = new jifenData()
- index_3.name = "县令"
- index_3.score = 100
- jifenDataConfig._instance.level_config.set("3",index_3)
- let index_4 = new jifenData()
- index_4.name = "都尉"
- index_4.score = 200
- jifenDataConfig._instance.level_config.set("4",index_4)
- let index_5 = new jifenData()
- index_5.name = "校尉"
- index_5.score = 350
- jifenDataConfig._instance.level_config.set("5",index_5)
- let index_6 = new jifenData()
- index_6.name = "常伺"
- index_6.score = 500
- jifenDataConfig._instance.level_config.set("6",index_6)
- let index_7 = new jifenData()
- index_7.name = "中郎将"
- index_7.score = 700
- jifenDataConfig._instance.level_config.set("7",index_7)
- let index_8 = new jifenData()
- index_8.name = "太守"
- index_8.score = 900
- jifenDataConfig._instance.level_config.set("8",index_8)
- let index_9 = new jifenData()
- index_9.name = "刺史"
- index_9.score = 1200
- jifenDataConfig._instance.level_config.set("9",index_9)
- let index_10 = new jifenData()
- index_10.name = "将军"
- index_10.score = 1500
- jifenDataConfig._instance.level_config.set("10",index_10)
- let index_11 = new jifenData()
- index_11.name = "太尉"
- index_11.score = 1900
- jifenDataConfig._instance.level_config.set("11",index_11)
- let index_12 = new jifenData()
- index_12.name = "大将军"
- index_12.score = 2400
- jifenDataConfig._instance.level_config.set("12",index_12)
- let index_13 = new jifenData()
- index_13.name = "霸王"
- index_13.score = 3000
- jifenDataConfig._instance.level_config.set("13",index_13)
-
- }
- }
- export class jifenData{
- public name:string="";
- public score:number =0;
- }
|