jifenDataConfig.ts 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. import { _decorator, Component, Node } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('jifenDataConfig')
  4. export class jifenDataConfig {
  5. private static _instance: jifenDataConfig | null = null;
  6. public static get Instance() {
  7. if (jifenDataConfig._instance === null){
  8. jifenDataConfig._instance = new jifenDataConfig();
  9. jifenDataConfig._instance.initData()
  10. }
  11. return jifenDataConfig._instance;
  12. }
  13. public level_config = new Map();
  14. getDataByLevel(integral_level):jifenData{
  15. if(integral_level>=13){
  16. integral_level = 13;
  17. }
  18. return jifenDataConfig.Instance.level_config.get(integral_level+"")
  19. }
  20. private initData(){
  21. let index_1 = new jifenData()
  22. index_1.name = "草民"
  23. index_1.score = -400
  24. jifenDataConfig._instance.level_config.set("1",index_1)
  25. let index_2 = new jifenData()
  26. index_2.name = "县丞"
  27. index_2.score = 50
  28. jifenDataConfig._instance.level_config.set("2",index_2)
  29. let index_3 = new jifenData()
  30. index_3.name = "县令"
  31. index_3.score = 100
  32. jifenDataConfig._instance.level_config.set("3",index_3)
  33. let index_4 = new jifenData()
  34. index_4.name = "都尉"
  35. index_4.score = 200
  36. jifenDataConfig._instance.level_config.set("4",index_4)
  37. let index_5 = new jifenData()
  38. index_5.name = "校尉"
  39. index_5.score = 350
  40. jifenDataConfig._instance.level_config.set("5",index_5)
  41. let index_6 = new jifenData()
  42. index_6.name = "常伺"
  43. index_6.score = 500
  44. jifenDataConfig._instance.level_config.set("6",index_6)
  45. let index_7 = new jifenData()
  46. index_7.name = "中郎将"
  47. index_7.score = 700
  48. jifenDataConfig._instance.level_config.set("7",index_7)
  49. let index_8 = new jifenData()
  50. index_8.name = "太守"
  51. index_8.score = 900
  52. jifenDataConfig._instance.level_config.set("8",index_8)
  53. let index_9 = new jifenData()
  54. index_9.name = "刺史"
  55. index_9.score = 1200
  56. jifenDataConfig._instance.level_config.set("9",index_9)
  57. let index_10 = new jifenData()
  58. index_10.name = "将军"
  59. index_10.score = 1500
  60. jifenDataConfig._instance.level_config.set("10",index_10)
  61. let index_11 = new jifenData()
  62. index_11.name = "太尉"
  63. index_11.score = 1900
  64. jifenDataConfig._instance.level_config.set("11",index_11)
  65. let index_12 = new jifenData()
  66. index_12.name = "大将军"
  67. index_12.score = 2400
  68. jifenDataConfig._instance.level_config.set("12",index_12)
  69. let index_13 = new jifenData()
  70. index_13.name = "霸王"
  71. index_13.score = 3000
  72. jifenDataConfig._instance.level_config.set("13",index_13)
  73. }
  74. }
  75. export class jifenData{
  76. public name:string="";
  77. public score:number =0;
  78. }