我已经按照本教程http://www.raywenderlich.com/33750/cocos2d-x-tutorial-for-ios-and-android-getting-started,设法在cococs2d-x中创建一个android hello world项目.现在,当我向classes目录添加任何内容并尝试使用它们时,我会收到类似的错误
make: *** [obj/local/armeabi/libgame.so] Error 1
undefined reference to 'ConstAndStats::getDevice()'
Run Code Online (Sandbox Code Playgroud)
我该如何解决这些问题,并为我的eclipse项目添加已经运行的代码(在Xcode中)?
我想POINT
在埃菲尔做一个不可变的课.下面的代码定义了一个吗?和字段的{NONE}
可访问性是否足够?我可以写一些类不变的类,或者我怎样才能实现不变性?x
y
x = x'
class POINT
create
make
feature {NONE}
x: DOUBLE
y: DOUBLE
feature
make (x_: DOUBLE; y_: DOUBLE)
do
x := x_
y := y_
ensure
set: x = x_ and y = y_
end
feature --accessors
get_x: DOUBLE
do
Result := x
ensure
Result = x
end
end
Run Code Online (Sandbox Code Playgroud) 我试图用这段代码改变我的对象的图像(用作Sprite强制转换):
GetComponent<SpriteRenderer>().sprite = Resources.Load("GameObjects/Tiles/Hole") as Sprite;
Run Code Online (Sandbox Code Playgroud)
它不起作用,但这工作(使用<Sprite>):
GetComponent<SpriteRenderer>().sprite = Resources.Load<Sprite>("GameObjects/Tiles/Hole");
Run Code Online (Sandbox Code Playgroud)
有什么不同?
我正在尝试创建一个sh来删除Xcode的deriveddate文件夹的内容.我写了这个,它转到所需的文件夹,并列出内容,但当我删除#并尝试删除它,比它说
"**line 1: =~/Library/Developer/Xcode/DerivedData/: No such file or directory
Desktop Downloads Movies Pictures clitools.dmg
Documents Library Music Public
override r--r--r-- dajkaferenc/staff for Desktop/Christmas Game update/.git/objects/00/8b8026f772525ccff6c3361ecc6f3eb43d0d82?** "
$DIR="~/Library/Developer/Xcode/DerivedData/"
cd $DIR
ls
#rm -r -- "$DIR"*
Run Code Online (Sandbox Code Playgroud) 我下面有这个简单的代码,一个带有2个类型参数的模板。如果我用相同的类型声明了我的类(例如BidirectionalMap<int,int>
),则会收到错误消息:
int BidirectionalMap<T,S>::operator [](T) const' : member function already defined or declared
Run Code Online (Sandbox Code Playgroud)
这是我的模板代码:
template <class T, class S>
class BidirectionalMap{
int count(T t){
return 1;
}
int count(S s){
return 1;
}
};
Run Code Online (Sandbox Code Playgroud) 如果我有一个Point类,复制构造函数应如下所示:
Point(const Point &p);
Point(Point &p);
Run Code Online (Sandbox Code Playgroud)
但是,如果我想创建一个需要Point的构造函数呢?为什么它被视为复制构造函数而不是构造函数?
Point(const Point p)
Run Code Online (Sandbox Code Playgroud)
编译错误:"类"的复制构造函数"Point"可能没有"Point"类型的参数
抱歉这个蹩脚的问题,但我不知道如何搜索它.所以如果我有两个来自同一个类的事件,比如:
package {
import flash.events.Event;
public class StylingEvent extends Event{
public static const BLUE_BG:String = "blue_bg";
public static const GREEN_BG:String = "green_bg";
public function StylingEvent(type:String) {
super(type);
}
}}
Run Code Online (Sandbox Code Playgroud)
我需要添加两个eventlisteners,如:
gameData.addEventListener(StylingEvent.BLUE_BG, onChangeBg);
gameData.addEventListener(StylingEvent.GREEN_BG, onChangeBg);
Run Code Online (Sandbox Code Playgroud)
或者有可能像:
gameData.addEventListener( [any type of stylingEvent] , [some method]);
Run Code Online (Sandbox Code Playgroud)
谢谢
我试图使用:require("socket")
,但我在关于魔兽世界的论坛上说我不能使用require
命令.有没有其他方法可以实现这一目标?我想将数据从Lua线程传递到Java线程.
我正在尝试使用下面的类中的异常,但是当我调用该kivetel
方法时,程序总是失败。我认为它只会调用重试部分,而不是满足后置条件。但是它失败,并带有“ y_above_zero”后置违规。
class
KEYWORDS
create
make
feature
y:INTEGER
make
do
end
kivetel
do
ensure
y__above_zero: y > 0
rescue
y := 20
retry
end
end
Run Code Online (Sandbox Code Playgroud) c++ ×3
eiffel ×2
actionscript ×1
ads ×1
android ×1
c++11 ×1
caching ×1
chartboost ×1
class ×1
cocos2d-x ×1
constructor ×1
eclipse ×1
events ×1
exception ×1
flash ×1
immutability ×1
invariants ×1
java ×1
load ×1
lua ×1
macos ×1
point ×1
removeall ×1
renderer ×1
rescue ×1
resources ×1
rm ×1
shell ×1
sockets ×1
sprite ×1
templates ×1