//移动方向的枚举 var moveType = cc.Enum({ none: 0, moveUp: 1, moveRight: 2, moveDown: 3, moveLeft: 4, }); //公路方向的枚举 var HighwayType = cc.Enum({ none: 0,//空的, moveX: 1,//移动X方向时候的道路 moveY: 2,//移动Y方向时候的道路 ZebraCrossingX: 3,//斑马线 ZebraCrossingY: 4, }); //AI类型枚举 var AIType = cc.Enum({ TestGuy: -1, Visitor: -1, Tycoon: -1, Office: -1, Oligarchs: -1, Nabobess: -1, }); //工人AI类型枚举 var AI_Worker_Type = cc.Enum({ Rube: -1,//农夫 Lumberjack: -1,//伐木工 Miner: -1,//矿工 CarryGay: -1,//搬运工 }); //工人当前的状态 var AI_Animation_Type = cc.Enum({ None: -1, Walk: -1,//目前Run 和None都代表走路 Idle: -1,//站立 Carry: -1,//运输 CargoCarryEmpty: -1,//空的货物运输 CargoCarry: -1,//货物运输,有车 CargoCarryRaw: -1,//载货原料 }); //建筑的类型 var BuildType = cc.Enum({ //住房 Housing: -1, //农田 Farmland: -1, //采木场 TimberYard: -1, //矿坑 MiningPit: -1, //工厂 Factory: -1, //商店 Shop: -1, //特殊建筑 Special: -1, }); var goodsMaterialClass = cc.Class({ name: "goodsMaterialClass", properties: { //商品需要的材料 crops: { default: 0, type: cc.Integer, tooltip: '农作物', }, //商品需要的材料 wood: { default: 0, type: cc.Integer, tooltip: '木材', }, //商品需要的材料 mineral: { default: 0, type: cc.Integer, tooltip: '矿石', }, } }); //商品信息 var goods = cc.Class({ name: "goodsInfo", properties: { //是否在销售此商品 isItSale: { default: false, tooltip: '是否正在在销售这个商品', }, //商品id goodsId: { default: 0, type: cc.Integer, tooltip: '商品id', }, //商品名称 goodsName: { default: '', }, //商品价格 goodsPrice: { default: 0, type: cc.Integer, tooltip: '商品对应的价格', }, //商品销售效率 goodsSalesRate: { default: 0, type: cc.Integer, tooltip: '商品销售效率', }, //商品需要的材料 goodsMaterial: { default: null, type: goodsMaterialClass, tooltip: '商品需要的材料', }, } }); cc.Class({ extends: cc.Component, //Enum statics: { moveType, AIType, AI_Worker_Type, BuildType, goods, goodsMaterialClass, AI_Animation_Type, HighwayType }, });