代码要规范
前不久,项目快要上线了,在主城审核的时候发现内容有很多不规范的地方,模块封装的也不好。所以,再一次提醒我代码要规范,这个是必要的,为了让别人和自己都能看的清。
typedefenum
{
E_GIVE_NONE = -1,
E_GIVE_HAMER = 0,
E_GIVE_MOVE,
E_GIVE_TIME,
E_GIVE_RELASH,
E_GIVE_MONETY_1000,
E_GIVE_MONETY_2000,
E_GIVE_MONETY_3000,
E_GIVE_MONETY_4000,
E_GIVE_MONETY_5000,
E_GIVE_MONETY_6000
}GiveType;
typedefstruct SShopDesc
{
string name; //店长名称
string skill; //店长技能
string hobby; //店长爱好
}ShopDesc;
typedefstruct SShopInfo
{
int shop_id;
int star;
long lastRentTime; //上次收金币的时间
GiveType propInfo[SHOP_SHARE_PROP_MAX]; //分享该店所得道具
ShopDesc shopDesc;
bool isShared;
bool isActive;
}ShopInfo;
bool CreateShopInfo();
void DestroyShopInfo();
static bool CreateShopInfoDB();
static void InsertDefaultShopInfoToDB();
void UpdateShopSharedStateByShopIndexToDB(int shopIndex);
void UpdateShopRentTimeStateByShopIndexToDB(int shopIndex,long rentTime);
void UpdateShopActiveStateByShopIndexToDB(int shopIndex);
int GetShopCount();
ShopInfo* GetShopData(int id);
bool ShopIsShared(int shopIndex); //用来判断是否给道具
void ShareShop(int shopIndex); //分享shop
int GetShopStar(int shopIndex); //商店星级
void SetShopStar(int shopIndex,int star); //通过商店号改变星级
long GetShopLastRentTime(int shopIndex); //上次收账时间