virtual

cocos2d-X学习之主要类介绍:节点CCNode

六眼飞鱼酱① 提交于 2020-01-29 01:43:21
首先是类结构: 可以看到CCNode 几乎是游戏中处理的大部分类的父类,其主要有以下函数: virtual int getZOrder (void) //获取节点的顺序 virtual const CCPoint & getPosition (void) //获取节点的位置 virtual void setPosition (const CCPoint &var) //设置节点的位置 virtual CCArray * getChildren (void) //获取其所有子节点 virtual CCCamera * getCamera (void)//获取其对应的摄像机 virtual bool getIsVisible (void) //判断节点是否可见 virtual void setIsVisible (bool var) //设置节点可见性 virtual const CCPoint & getAnchorPoint (void) //获取节点的锚点的位置 virtual void setAnchorPoint (const CCPoint &var) //设置节点的锚点位置 virtual bool getIsRunning (void) //判断节点是否在运行 virtual CCNode * getParent (void)//获取父及节点指针 virtual

C++ 重载重写重定义

最后都变了- 提交于 2020-01-28 03:07:28
重载(添加): 相同的范围(在同一个类中) 函数名字相同 参数不同 virtual关键字可有可无 重写(覆盖) 是指派生类函数覆盖基类函数,特征是: 不同的范围,分别位于基类和派生类中 函数的名字相同 参数相同 基类函数必须有 virtual 关键字 重定义(隐藏) 是指派生类的函数屏蔽了与其同名的基类函数,规则如下: 如果派生类的函数和基类的函数同名,但是参数不同,此时,不管有无 virtual ,基类的函数被隐藏。 如果派生类的函数与基类的函数同名,并且参数也相同,但是基类函数没有 vitual 关键字,此时,基类的函数被隐藏。 注意: 当发生重定义时,子类函数会覆盖父类同名函数,此时无法通过子类对象直接调用父类同名函数;但可以通过域作用符 :: 显式地调用父类同名函数 来源: CSDN 作者: banjitino 链接: https://blog.csdn.net/Ai_King/article/details/104065760

C# Queue队列的介绍

孤街醉人 提交于 2020-01-27 22:26:30
使用场合 如果所存储的第一个对象正是要使用的第一个对象,就要使用Queue(队列),例如: 沿着单向街道行进的车流 排队的人 不挂机等候客户支持热线服务的客户 所有按先来先服务原则处理的情况 和List相比Queue的特点 不能按任意索引增加或删除项 增加对象时要入队(enqueue) 删除对象时,将第一个对象出队(dequeue) Queue 类的一些常用的 属性: 属性 描述 Count 获取 Queue 中包含的元素个数。 Queue 类的一些常用的 方法: public virtual void Clear(); 从 Queue 中移除所有的元素。 public virtual bool Contains( object obj ); 判断某个元素是否在Queue 中。 public virtual object Dequeue() 移除并返回在 Queue 的开头的对象。 public virtual void Enqueue( object obj ); 向 Queue 的末尾添加一个对象。 public virtual object[] ToArray(); 复制 Queue 到一个新的数组中。 public virtual void TrimToSize(); 设置容量为 Queue 中元素的实际个数。 来源: CSDN 作者: 柳落青 链接: https:/

setV:一个管理 Python 虚拟环境的 Bash 函数

岁酱吖の 提交于 2020-01-26 00:55:44
了解一下 setV,它是一个轻量级的 Python 虚拟环境管理器,是 virtualenvwrapper 的替代产品。-- Sachin Patil(作者) 这一年多来,我的 bash_scripts 项目中悄悄隐藏这 setV ,但现在是时候该公开了。setV 是一个 Bash 函数,我可以用它代替 virtualenvwrapper 。它提供了使你能够执行以下操作的基本功能: 默认使用 Python 3 创建一个新的虚拟环境 使用带有 -p(或 --python)的自定义 Python 路径来创建新的虚拟环境 删除现有的虚拟环境 列出所有现有的虚拟环境 使用制表符补全(以防你忘记虚拟环境名称) 安装 要安装 setV,请下载该脚本: curl https://gitlab.com/psachin/setV/raw/master/install.sh 审核一下脚本,然后运行它: sh ./install.sh 当安装 setV 时,安装脚本会要求你引入(source)一下 ~/.bashrc 或 ~/.bash_profile 的配置,根据你的喜好选择一个。 用法 基本的命令格式是 setv。 创建虚拟环境 setv --new rango # setv -n rango# 或使用定制的 Python 路径setv --new --python /opt/python

海马玩模拟器启动失败,start machine failed! error code = 3和error code=21

不问归期 提交于 2020-01-24 07:58:25
ssdwin7安装visual studio 2019,另外打开网页,终于在最后时刻死机…… 然后ghost重装,几次插拔然后ssd不见了…… 重新买ssd,然后重装。 ……这些都是前戏…… 今天打开ghost里面的海马玩模拟器,结果报错: start machine failed! error code = 3。 搜索各种方法,找官方论坛,都不行。 打开bios开virtual technology。不行。 在官网海马苹果社区,搜索start machine failed! error code = 3, http://forum.droid4x.cn/search.php?mod=forum&searchid=10&orderby=lastpost&ascdesc=desc&searchsubmit=yes&kw=start+machine+failed%21+error+code+%3D+21 各种方法都不行。 删了c盘program files下面Oracle也不行。 控制面板卸载virtual box也不行。 修复工具不行。 重装官方完整版virtual box,之后重装海马玩,error code变成了21. http://forum.droid4x.cn/forum.php?mod=viewthread&tid=43521&highlight=start

c++ 结构型模式-适配器(Adapter)

ⅰ亾dé卋堺 提交于 2020-01-23 19:31:35
1) 意图: 将一个类的接口转换成客户希望的另一个接口。适配器模式使得原本由于接口不兼容而不能一起工作的那些类可以一起工作 2) 结构: 适配器两种结构,一种继承实现,一种组合实现   a. 继承方式:    b. 组合方式:    其中: Target 定义 Client 使用的与特定领域相关的接口 Client 与符合 Target 接口的对象协同 Adaptee 定义一个已经存在的接口,这个接口需要适配 Adapter 对 Adaptee 的接口与 Target 接口进行适配 3) 适用性: 想使用一个类,但是它的接口不符合要求 想创建一个可以用的类,该类可以和其他不相关的类或不可预见的类协同工作 想使用一个已经存在的子类,但是不可能对每一个都进行子类化以匹配它们的接口 4) 举例:   a. 继承方式:    1 #include <iostream> 2 class Target 3 { 4 public: 5 Target() {} 6 virtual ~Target() {} 7 virtual std::string Request() = 0; 8 }; 9 10 class Adaptee 11 { 12 public: 13 Adaptee() {} 14 virtual ~Adaptee() {} 15 void SpecificRequest(std:

c++设计模式-原型模式

廉价感情. 提交于 2020-01-23 15:53:16
动机 在软件系统中,经常面临着“某些结构复杂的对象”的创建工作;由于需求的变化,这些对象经常面临着剧烈的变化,但是他们却拥有比较稳定一致的接口。 如何应对这种变化?如何向“客户程序(使用这些对象的程序)”隔离出“这些易变对象”,从而使得“依赖这些易变对象的客户程序”不随着需求改变而改变? 模式定义 使用原型实例指定创建对象的种类,然后通过拷贝这些原型来创建信的对象。 ——《设计模式》GoF 结构 示例 //抽象类 class ISplitter{ public: virtual void split()=0; virtual ISplitter* clone()=0; //通过克隆自己来创建对象 virtual ~ISplitter(){} }; //具体类 class BinarySplitter : public ISplitter{ public: virtual ISplitter* clone(){ return new BinarySplitter(*this);//调用自身的拷贝构造函数 } }; class TxtSplitter: public ISplitter{ public: virtual ISplitter* clone(){ return new TxtSplitter(*this); } }; class PictureSplitter:

c# screen capture virtual desktop

核能气质少年 提交于 2020-01-23 12:34:15
问题 I've found a way to create virtual desktops with c#. Now I was wondering if we can take a screenshot of a particular desktop and if so how ? Thanks in advance Blizz 回答1: HAve you tried the CopyFromScreen method in the GFX Object Graphics g = new Graphics(); g.CopyFromScreen( ....params.... ) 回答2: I haven't tried it but the first thing I'd try is: create a new thread switch the thread to the new desktop by calling SetThreadDesktop take a screen shot switch thread back might just work. 来源:

c# screen capture virtual desktop

混江龙づ霸主 提交于 2020-01-23 12:33:47
问题 I've found a way to create virtual desktops with c#. Now I was wondering if we can take a screenshot of a particular desktop and if so how ? Thanks in advance Blizz 回答1: HAve you tried the CopyFromScreen method in the GFX Object Graphics g = new Graphics(); g.CopyFromScreen( ....params.... ) 回答2: I haven't tried it but the first thing I'd try is: create a new thread switch the thread to the new desktop by calling SetThreadDesktop take a screen shot switch thread back might just work. 来源:

c# screen capture virtual desktop

谁说我不能喝 提交于 2020-01-23 12:33:45
问题 I've found a way to create virtual desktops with c#. Now I was wondering if we can take a screenshot of a particular desktop and if so how ? Thanks in advance Blizz 回答1: HAve you tried the CopyFromScreen method in the GFX Object Graphics g = new Graphics(); g.CopyFromScreen( ....params.... ) 回答2: I haven't tried it but the first thing I'd try is: create a new thread switch the thread to the new desktop by calling SetThreadDesktop take a screen shot switch thread back might just work. 来源: