01 2015 档案
摘要:人物上线block格子通知(相当重要了)人物上线需要看到可视范围内玩家,npc,玩家,同时附近玩家也需要看到本玩家上线对于进入地图switch (eBlockChange){case Map::eBlockChange_EnterMap: { m_MapBlockMgr.Proc...
阅读全文
摘要:map 玩家上线else if(gs2ms_add_player == pkt.cmd){ PlayerChannel* pPC = new PlayerChannel(this); //加到地图中,但是并未激活该玩家 int nChannelId = pPC->OnPlayerE...
阅读全文
摘要:#ifndef _RingQueue_H_#define _RingQueue_H_#include templateclass RingQueue{public: //----------------------------------------------------- // 构造...
阅读全文
摘要:早晨起早洗了个早,感觉还早小睡一下,结果一觉睡到了9点40,上个月本来迟到的就很多,又弄出这种情况,被经理问东问西的,我现在都不好意思再迟到了。。
阅读全文
摘要:#include #include void f(int& n1, int& n2, const int& n3){ std::cout bound_f = std::bind(f, n1, std::ref(n2), std::cref(n3)); n1 = 10; n2 = ...
阅读全文
摘要:#include class Point3d{public: virtual ~Point3d(){}public: static Point3d origin; float x, y, z;};//从打印的地址看出这个类的结构应该是vptr|x|y|z,vptr是放类空间的头部的...
阅读全文
摘要:#include using namespace std;//关于类不展现按位拷贝语义的几种情况/** *1.类的成员对象含有默认拷贝函数 *2.继承的基类包含拷贝函数(无论是合成的还是自己定义的) *3.有虚函数,因为虚指针按位拷贝有问题 *4.派生自虚基类 */ class Word{publ...
阅读全文
摘要:#include using namespace std;//word类展现了默认拷贝语义,不会合成默认拷贝构造函数,而是对于每一个成员变量实时memberwise的bitcopyclass Word{public: Word(const char*) { } ~Word()...
阅读全文
摘要:#include using namespace std;class A{public: virtual ~A(){cout<<"A destructor---"<<endl;}};class B:public A{public: B(){cout<<"B----constructor-...
阅读全文
摘要:有时候,基类构造函数是带有参数,而子类构造函数是不带参数的,如下:class Animal{public: Animal(int width, int height) { this->width = width; this->height = height; }private: int ...
阅读全文
摘要:/***1.宏会在编译器在对源代码进行编译的时候进行简单替换,不会进行任何逻辑检测,即简单代码复制而已。2.宏进行定义时不会考虑参数的类型。3.参数宏的使用会使具有同一作用的代码块在目标文件中存在多个副本,即会增长目标文件的大小。4.参数宏的运行速度会比函数快,因为不需要参数压栈/出栈操作。5.参数...
阅读全文