GameStates.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. //移动方向的枚举
  2. var moveType = cc.Enum({
  3. none: 0,
  4. moveUp: 1,
  5. moveRight: 2,
  6. moveDown: 3,
  7. moveLeft: 4,
  8. });
  9. //公路方向的枚举
  10. var HighwayType = cc.Enum({
  11. none: 0,//空的,
  12. moveX: 1,//移动X方向时候的道路
  13. moveY: 2,//移动Y方向时候的道路
  14. ZebraCrossingX: 3,//斑马线
  15. ZebraCrossingY: 4,
  16. });
  17. //AI类型枚举
  18. var AIType = cc.Enum({
  19. TestGuy: -1,
  20. Visitor: -1,
  21. Tycoon: -1,
  22. Office: -1,
  23. Oligarchs: -1,
  24. Nabobess: -1,
  25. });
  26. //工人AI类型枚举
  27. var AI_Worker_Type = cc.Enum({
  28. Rube: -1,//农夫
  29. Lumberjack: -1,//伐木工
  30. Miner: -1,//矿工
  31. CarryGay: -1,//搬运工
  32. });
  33. //工人当前的状态
  34. var AI_Animation_Type = cc.Enum({
  35. None: -1,
  36. Walk: -1,//目前Run 和None都代表走路
  37. Idle: -1,//站立
  38. Carry: -1,//运输
  39. CargoCarryEmpty: -1,//空的货物运输
  40. CargoCarry: -1,//货物运输,有车
  41. CargoCarryRaw: -1,//载货原料
  42. });
  43. //建筑的类型
  44. var BuildType = cc.Enum({
  45. //住房
  46. Housing: -1,
  47. //农田
  48. Farmland: -1,
  49. //采木场
  50. TimberYard: -1,
  51. //矿坑
  52. MiningPit: -1,
  53. //工厂
  54. Factory: -1,
  55. //商店
  56. Shop: -1,
  57. //特殊建筑
  58. Special: -1,
  59. });
  60. var goodsMaterialClass = cc.Class({
  61. name: "goodsMaterialClass",
  62. properties: {
  63. //商品需要的材料
  64. crops: {
  65. default: 0,
  66. type: cc.Integer,
  67. tooltip: '农作物',
  68. },
  69. //商品需要的材料
  70. wood: {
  71. default: 0,
  72. type: cc.Integer,
  73. tooltip: '木材',
  74. },
  75. //商品需要的材料
  76. mineral: {
  77. default: 0,
  78. type: cc.Integer,
  79. tooltip: '矿石',
  80. },
  81. }
  82. });
  83. //商品信息
  84. var goods = cc.Class({
  85. name: "goodsInfo",
  86. properties: {
  87. //是否在销售此商品
  88. isItSale: {
  89. default: false,
  90. tooltip: '是否正在在销售这个商品',
  91. },
  92. //商品id
  93. goodsId: {
  94. default: 0,
  95. type: cc.Integer,
  96. tooltip: '商品id',
  97. },
  98. //商品名称
  99. goodsName: {
  100. default: '',
  101. },
  102. //商品价格
  103. goodsPrice: {
  104. default: 0,
  105. type: cc.Integer,
  106. tooltip: '商品对应的价格',
  107. },
  108. //商品销售效率
  109. goodsSalesRate: {
  110. default: 0,
  111. type: cc.Integer,
  112. tooltip: '商品销售效率',
  113. },
  114. //商品需要的材料
  115. goodsMaterial: {
  116. default: null,
  117. type: goodsMaterialClass,
  118. tooltip: '商品需要的材料',
  119. },
  120. }
  121. });
  122. cc.Class({
  123. extends: cc.Component,
  124. //Enum
  125. statics: {
  126. moveType,
  127. AIType,
  128. AI_Worker_Type,
  129. BuildType,
  130. goods,
  131. goodsMaterialClass,
  132. AI_Animation_Type,
  133. HighwayType
  134. },
  135. });