08 2012 档案

为数据结构添加setProperty和getProperty
摘要:为手头游戏项目写编器,关联编器和游戏中的游戏对象的属性成了一个不小的问题,经过多经改写总算有一个相对好点的方案了,如果大家有更好的解决方案,请指点:不废话,上代码:原文地址:http://blog.csdn.net/wzq9706/article/details/7924881myProperty.h// 王智泉#ifndef __myProperty__H__#define __myProperty__H__#include #include // @注意: 以下的宏只能在CPP文件中使用/* 定义一个属性@param ownerClass: 宿主类@param propertyName: 阅读全文

posted @ 2012-08-30 13:38 几百人有爱 阅读(244) 评论(0) 推荐(0)

一个简单观察者模式的实现 cocos2dx
摘要:头文件// 王智泉 2012/06/11#ifndef __myNotification__H__#define __myNotification__H__#include "CCPlatformMacros.h"#include #include #include // 回调class myNotification;class myCallbackBase{public: myCallbackBase(){} virtual bool operator()(const myNotification& notification) = 0;};templateclas 阅读全文

posted @ 2012-08-22 15:50 几百人有爱 阅读(171) 评论(0) 推荐(0)

c++ 多状态设置
摘要:http://blog.csdn.net/wzq9706/article/details/7858711// 王智泉enum { ST_1 = 0x01 << 1; // 状态1 ST_2 = 0x01 << 2; // 状态2 ST_3 = 0x01 << 3; // 状态3 ST_4 = 0x01 << 4; // 状态4 ST_5 = 0x01 << 5; // 状态5};class StateTest{public: StateTest():_state(0){} ~StateTest(){} // 设置指定状态 // @pa 阅读全文

posted @ 2012-08-13 09:28 几百人有爱 阅读(231) 评论(0) 推荐(0)