//移动方向的枚举 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 AI_Worker_Type = cc.Enum({ Rube: -1,//农夫 Lumberjack: -1,//伐木工 Miner: -1,//矿工 CarryGay: -1,//搬运工 Nothing: -1,//无状态时候 }); //工人当前的状态 var AI_Animation_Type = cc.Enum({ None: -1,//没有状态 Walk: -1,//目前Run Idle: -1,//站立 Hatchet: -1,//砍树 Pickaxe: -1,//挖矿 Poke: -1,//摘果实 CargoCarryBox: -1,//货物运输,有车 CargoCarryRaw: -1,//载货原料 }); //建筑的类型 var BuildType = cc.Enum({ //住房 Housing: -1, //农田 Farmland: -1, //采木场 TimberYard: -1, //矿坑 MiningPit: -1, //工厂 Factory: -1, //商店 Shop: -1, //特殊建筑 Special: -1, //神农小镇 种子土地 HolyFarmland:-1 }); /** * 神龙小镇的种子类型 * todo 后续可能根据DragonTownFarmland 需要种子的类型来确定播种 */ var SeedType = cc.Enum({ //Normal -- 默认对应 DragonTownFarmland Normal:0, }); 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, AI_Worker_Type, BuildType, goods, goodsMaterialClass, AI_Animation_Type, HighwayType, SeedType }, });