GameStates.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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 AI_Worker_Type = cc.Enum({
  19. Rube: -1,//农夫
  20. Lumberjack: -1,//伐木工
  21. Miner: -1,//矿工
  22. CarryGay: -1,//搬运工
  23. Nothing: -1,//无状态时候
  24. });
  25. //工人当前的状态
  26. var AI_Animation_Type = cc.Enum({
  27. None: -1,//没有状态
  28. Walk: -1,//目前Run
  29. Idle: -1,//站立
  30. Hatchet: -1,//砍树
  31. Pickaxe: -1,//挖矿
  32. Poke: -1,//摘果实
  33. CargoCarryBox: -1,//货物运输,有车
  34. CargoCarryRaw: -1,//载货原料
  35. });
  36. //建筑的类型
  37. var BuildType = cc.Enum({
  38. //住房
  39. Housing: -1,
  40. //农田
  41. Farmland: -1,
  42. //采木场
  43. TimberYard: -1,
  44. //矿坑
  45. MiningPit: -1,
  46. //工厂
  47. Factory: -1,
  48. //商店
  49. Shop: -1,
  50. //特殊建筑
  51. Special: -1,
  52. });
  53. var goodsMaterialClass = cc.Class({
  54. name: "goodsMaterialClass",
  55. properties: {
  56. //商品需要的材料
  57. crops: {
  58. default: 0,
  59. type: cc.Integer,
  60. tooltip: '农作物',
  61. },
  62. //商品需要的材料
  63. wood: {
  64. default: 0,
  65. type: cc.Integer,
  66. tooltip: '木材',
  67. },
  68. //商品需要的材料
  69. mineral: {
  70. default: 0,
  71. type: cc.Integer,
  72. tooltip: '矿石',
  73. },
  74. }
  75. });
  76. //商品信息
  77. var goods = cc.Class({
  78. name: "goodsInfo",
  79. properties: {
  80. //是否在销售此商品
  81. isItSale: {
  82. default: false,
  83. tooltip: '是否正在在销售这个商品',
  84. },
  85. //商品id
  86. goodsId: {
  87. default: 0,
  88. type: cc.Integer,
  89. tooltip: '商品id',
  90. },
  91. //商品名称
  92. goodsName: {
  93. default: '',
  94. },
  95. //商品价格
  96. goodsPrice: {
  97. default: 0,
  98. type: cc.Integer,
  99. tooltip: '商品对应的价格',
  100. },
  101. //商品销售效率
  102. goodsSalesRate: {
  103. default: 0,
  104. type: cc.Integer,
  105. tooltip: '商品销售效率',
  106. },
  107. //商品需要的材料
  108. goodsMaterial: {
  109. default: null,
  110. type: goodsMaterialClass,
  111. tooltip: '商品需要的材料',
  112. },
  113. }
  114. });
  115. cc.Class({
  116. extends: cc.Component,
  117. //Enum
  118. statics: {
  119. moveType,
  120. AI_Worker_Type,
  121. BuildType,
  122. goods,
  123. goodsMaterialClass,
  124. AI_Animation_Type,
  125. HighwayType
  126. },
  127. });