- 博客(10)
- 资源 (2)
- 收藏
- 关注
转载 Socket粘包问题
这两天看csdn有一些关于socket粘包,socket缓冲区设置的问题,发现自己不是很清楚,所以查资料了解记录一下: 一两个简单概念长连接与短连接:1.长连接 Client方与Server方先建立通讯连接,连接建立后不断开, 然后再进行报文发送和接收。2.短连接 Client方与Server每进行一次报文收发交易时才进行通讯连接,交易完毕后
2014-09-28 13:49:30 582
转载 C++11 random 随机数的使用而已没有原理
因为在看的那个工程有个关于采样的类,里面有一些这样的东西:private: std::mt19937 eng; std::uniform_int_distribution axis_dist; std::uniform_real_distribution fraction_dist;所以看了一下随机数的东西,这是C++11的一些扩展内容,boost里面也有了很久了。使
2014-09-27 16:51:22 1649
转载 【cocos2d-x3.2游戏开发】 lua 类, 继承, 面向对象
1.lua中的类 lua中其实是没有类的,有的只是表(table),而类之间的继承也就是将父类的表连到了一起,派生类中没有找到的属性和方法就通过元表查找父类2.lua中类的属性 classA = {width =10, height=10} classA={} classA.width=10 classA.height=10
2014-09-09 20:24:09 1911
转载 class() 高级用法 -- lua
class() 高级用法class() 除了定义纯 Lua 类之外,还可以从 C++ 对象继承类。比如需要创建一个工具栏,并在添加按钮时自动排列已有的按钮,那么我们可以使用如下的代码:-- 从 CCNode 对象派生 Toolbar 类,该类具有 CCNode 的所有属性和行为local Toolbar = class("Toolbar", function()
2014-09-09 16:30:37 725
转载 --Create an class.
--Create an class.function class(classname, super) local superType = type(super) local cls if superType ~= "function" and superType ~= "table" then superTyp
2014-09-09 16:26:16 530
转载 Quick-Cocos2D-X 并成功运行示例代码
有好多天没有写博文了,今天三国制霸iOS版本进度快结束了。自己也终于有时间继续写博文与大家交流。今年,中国的手机网游市场很火,很多公司也需要Cocos2d的人才,所以有很多做页游端游的同行也一起加入了手游的大家庭(同时也增加了竞争力)。不过这样也是件好事,有追赶的时候,我们进步的能更快。 但是,如何能让自己在如此之多的同行之中脱颖而出呢?答案就在
2014-09-07 21:11:12 2732
转载 关于setpeer和getpeer的作用
每个C++对象需要存贮自己的成员变量的值,这个值不能够存贮在元表里(因为元表是类共用的),所以每个对象要用一个私有的表来存贮,这个表在tolua里叫做peer表。元表的__index指向了一个C函数,当在Lua中要访问一个C++对象的成员变量(准确的说是一个域)时,会调用这个C函数,在这个C函数中,会查找各个关联表来取得要访问的域,这其中就包括peer表的查询。
2014-09-07 19:48:34 4856
转载 [Lua]用__index/__newindex来限制访问
网友问了一个问题,说对象A在内部可以修改HP.外部对象只能访问对象A的HP,不能修改.这东西其实可以用__index和__newindex来实现.__index指向对象A,这样就可以访问;__newindex重写,修改hp的话,就禁止.就可以完成他的需求.下面给出简单的代码:function cannotModifyHp(
2014-09-07 19:46:36 659
转载 lua面向对象编程之点号与冒号的差异详细比较
2011-07-28 02:02 by youxiachai, 9067 阅读, 9 评论, 收藏, 编辑首先,先来一段在lua创建一个类与对象的代码12345678910111213141516171819
2014-09-07 19:25:47 976
转载 Lua脚本语法说明(修订)
Lua脚本语法说明(增加lua5.1部份特性) Lua 的语法比较简单,学习起来也比较省力,但功能却并不弱。 所以,我只简单的归纳一下Lua的一些语法规则,使用起来方便好查就可以了。估计看完了,就懂得怎么写Lua程序了。 在Lua中,一切都是变量,除了关键字。I. 首先是注释 写一个程序,总是少不了注释的。 在Lua中,你可以使用单行注释和多行注释。
2014-09-07 19:24:47 940
URP Debug Views 1.0.4.zip
2021-07-23
房燕良-虚幻4渲染系统架构解析
2019-02-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人