Cocos2d-x 3.0final 终结者系列教程12-Vector&map&value

北京时间昨天下午,温40度。中午12:16我来到了篮球场点。思维1分钟决定开站

转球:

我和另一个3队友半开始,

我手中的球的那一刻我突然火爆球不稳,突然问,淡淡的味道橡胶和烧烤的味道混合。

个腾空跳投,

球---------爆炸了。。。。。。

听新闻说昨天在路上都是 “熟人”

一位老大爷不慎被车刮倒了,大爷二话没说立刻爬了起来,围观众人议论纷纷:

“大爷人不错”,“大爷素养真高”。“大爷身体可真好”

大爷说:

“快拉 秦皇岛吧。烫腚”。

预计昨天又有不少沿街乞讨人士和流浪狗失去生命(咋没人管管)

------------------------------------------------切割线---------------------------------------------------

在做Cocos2d-x2.0人的人们预计正在使用CCArray,CCDirectionary,CCDouble,CCFloat这些正搞得非常爽,但不得不说

它们在V3.0中不用了。

看下3.0中的数据结合类Vector,Map,Value(建议大家自行阅读源代码,本文仅仅介绍怎样使用,关于引用计数的概念推荐大家看我的视频)。

下面案例来自TestCpp:

void TemplateVectorTest::onEnter()

{

UnitTestDemo::onEnter();

Vector<Node*> vec;//定义一个向量。事实上是对stl Vector的封装,仅仅是增加了对象的内存计数管理

CCASSERT(vec.empty(),
"");

CCASSERT(vec.capacity() ==
0, "");

CCASSERT(vec.size() ==
0, "");

CCASSERT(vec.max_size() >
0, "");

auto node1 = Node::create();

node1->setTag(1);

vec.pushBack(node1);//在向量加入一个元素

CCASSERT(node1->getReferenceCount() ==
2, "");

auto node2 = Node::create();

node2->setTag(2);

  vec.pushBack(node2);//加入元素 编号会从0開始

CCASSERT(vec.getIndex(node1) ==
0, "");

CCASSERT(vec.getIndex(node2) ==
1, "");

auto node3 = Node::create();

node3->setTag(3);

vec.insert(1, node3); //插入元素

CCASSERT(vec.at(0)->getTag() ==
1, "");

CCASSERT(vec.at(1)->getTag() ==
3, "");

CCASSERT(vec.at(2)->getTag() ==
2, "");

// Test copy constructor

Vector<Node*> vec2(vec);  //复制一个向量

    CCASSERT(vec2.size() == vec.size(),
"");

ssize_t size = vec.size();

for (ssize_t i =
0; i < size; ++i)

{

CCASSERT(vec2.at(i) == vec.at(i),
"");

CCASSERT(vec.at(i)->getReferenceCount() ==
3, "");

CCASSERT(vec2.at(i)->getReferenceCount() ==
3, "");

}

// Test copy assignment operator

Vector<Node*> vec3;

vec3 = vec2;

CCASSERT(vec3.size() == vec2.size(),
"");

size = vec3.size();

for (ssize_t i =
0; i < size; ++i)

{

CCASSERT(vec3.at(i) == vec2.at(i),
"");

CCASSERT(vec3.at(i)->getReferenceCount() ==
4, "");

CCASSERT(vec2.at(i)->getReferenceCount() ==
4, "");

CCASSERT(vec.at(i)->getReferenceCount() ==
4, "");

}

// Test move constructor (Lambda 表达式,定义一个函数用于创建一个Vector,关于Lambda建议看我的视频)

auto createVector = [this](){

Vector<Node*> ret;

for (int i =
0; i < 20; i++)

{

ret.pushBack(Node::create());

}

int j = 1000;

for (auto& child : ret)

{

child->setTag(j++);

}

return ret;

};

Vector<Node*> vec4(createVector());

for (const
auto& child : vec4)

{

CC_UNUSED_PARAM(child);

CCASSERT(child->getReferenceCount() ==
2, "");

}

// Test init Vector<T> with capacity

Vector<Node*> vec5(10);

CCASSERT(vec5.capacity() ==
10, "");

vec5.reserve(20);

CCASSERT(vec5.capacity() ==
20, "");

CCASSERT(vec5.size() ==
0, "");

CCASSERT(vec5.empty(),
"");

auto toRemovedNode = Node::create();

vec5.pushBack(toRemovedNode);

CCASSERT(toRemovedNode->getReferenceCount() ==
2, "");

// Test move assignment operator

vec5 = createVector();

CCASSERT(toRemovedNode->getReferenceCount() ==
1, "");

CCASSERT(vec5.size() ==
20, "size should be 20");

    for (const
auto& child : vec5)    //这也是C++11新特性,好用吧,不像STL用迭代器那么麻烦

{

CC_UNUSED_PARAM(child);

CCASSERT(child->getReferenceCount() ==
2, "");

}

// Test Vector<T>::find

CCASSERT(vec.find(node3) == (vec.begin() +
1), "");

CCASSERT(std::find(std::begin(vec),
std::end(vec), node2) == (vec.begin() +
2), "");

CCASSERT(vec.front()->getTag() ==
1, "");

CCASSERT(vec.back()->getTag() ==
2, "");

CCASSERT(vec.getRandomObject(),
"");

CCASSERT(!vec.contains(Node::create()),
"");

CCASSERT(vec.contains(node1),
"");

CCASSERT(vec.contains(node2),
"");

CCASSERT(vec.contains(node3),
"");

CCASSERT(vec.equals(vec2),
"");

CCASSERT(vec.equals(vec3),
"");

// Insert

vec5.insert(2, node1);

CCASSERT(vec5.at(2)->getTag() ==
1, "");

CCASSERT(vec5.size() ==
21, "");

vec5.back()->setTag(100);

vec5.popBack();

CCASSERT(vec5.size() ==
20, "");

CCASSERT(vec5.back()->getTag() !=
100, "");

// Erase and clear

Vector<Node*> vec6 = createVector();

Vector<Node*> vec7 = vec6; 
// Copy for check

CCASSERT(vec6.size() ==
20, "");

vec6.erase(vec6.begin() +
1);  //

CCASSERT(vec6.size() ==
19, "");

CCASSERT((*(vec6.begin() +
1))->getTag() ==
1002, "");

vec6.erase(vec6.begin() +
2, vec6.begin() +
10);

CCASSERT(vec6.size() ==
11, "");

CCASSERT(vec6.at(0)->getTag() ==
1000, "");

CCASSERT(vec6.at(1)->getTag() ==
1002, "");

CCASSERT(vec6.at(2)->getTag() ==
1011, "");

CCASSERT(vec6.at(3)->getTag() ==
1012, "");

vec6.erase(3);

CCASSERT(vec6.at(3)->getTag() ==
1013, "");

vec6.eraseObject(vec6.at(2));

CCASSERT(vec6.at(2)->getTag() ==
1013, "");

vec6.clear();

auto objA =
Node::create();
// retain count is 1

auto objB = Node::create();

auto objC = Node::create();

{

Vector<Node*> array1;

Vector<Node*> array2;

// push back objA 3 times

array1.pushBack(objA);
// retain count is 2

array1.pushBack(objA);
// retain count is 3

array1.pushBack(objA);
// retain count is 4

array2.pushBack(objA);
// retain count is 5

array2.pushBack(objB);

array2.pushBack(objC);

for (auto obj : array1) {

array2.eraseObject(obj);

}

CCASSERT(objA->getReferenceCount() ==
4, "");

}

CCASSERT(objA->getReferenceCount() ==
1, "");

{    //这是一个代码块。出了块引用计数会恢复。是一个AutoReleasePool

        Vector<Node*> array1;

// push back objA 3 times

array1.pushBack(objA);
// retain count is 2

array1.pushBack(objA);
// retain count is 3

array1.pushBack(objA);
// retain count is 4

CCASSERT(objA->getReferenceCount() ==
4, "");

array1.eraseObject(objA,
true); // Remove all occurrences in the Vector.

CCASSERT(objA->getReferenceCount() ==
1, "");

array1.pushBack(objA);
// retain count is 2

array1.pushBack(objA);
// retain count is 3

array1.pushBack(objA);
// retain count is 4

array1.eraseObject(objA,
false);

CCASSERT(objA->getReferenceCount() ==
3, "");
// Only remove the first occurrence in the Vector.

}

// Check the retain count in vec7

CCASSERT(vec7.size() ==
20, "");

for (const
auto& child : vec7)

{

CC_UNUSED_PARAM(child);

CCASSERT(child->getReferenceCount() ==
2, "");

}

// Sort  排序。结合Lambda

Vector<Node*> vecForSort = createVector();

std::sort(vecForSort.begin(), vecForSort.end(), [](Node* a,
Node* b){

return a->getTag() >= b->getTag();

});

for (int i =
0; i < 20; ++i)

{

CCASSERT(vecForSort.at(i)->getTag() -
1000 == (19 - i),
"");

}

// Reverse

vecForSort.reverse();

for (int i =
0; i < 20; ++i)

{

CCASSERT(vecForSort.at(i)->getTag() -
1000 == i, "");

}

// Swap

Vector<Node*> vecForSwap = createVector();

vecForSwap.swap(2,
4);

CCASSERT(vecForSwap.at(2)->getTag() ==
1004, "");

CCASSERT(vecForSwap.at(4)->getTag() ==
1002, "");

vecForSwap.swap(vecForSwap.at(2), vecForSwap.at(4));

CCASSERT(vecForSwap.at(2)->getTag() ==
1002, "");

CCASSERT(vecForSwap.at(4)->getTag() ==
1004, "");

// shrinkToFit

Vector<Node*> vecForShrink = createVector();

vecForShrink.reserve(100);

CCASSERT(vecForShrink.capacity() ==
100, "");

vecForShrink.pushBack(Node::create());

vecForShrink.shrinkToFit();

CCASSERT(vecForShrink.capacity() ==
21, "");

// get random object

// Set the seed by time

srand((unsigned)time(nullptr));

Vector<Node*> vecForRandom = createVector();

log("<--- begin ---->");

for (int i =
0; i < vecForRandom.size(); ++i)

{

log("Vector: random object tag = %d", vecForRandom.getRandomObject()->getTag());

}

log("<---- end  ---->");

// Self assignment

Vector<Node*> vecSelfAssign = createVector();

vecSelfAssign = vecSelfAssign;

CCASSERT(vecSelfAssign.size() ==
20, "");

for (const
auto& child : vecSelfAssign)

{

CC_UNUSED_PARAM(child);

CCASSERT(child->getReferenceCount() ==
2, "");

}

vecSelfAssign = std::move(vecSelfAssign);

CCASSERT(vecSelfAssign.size() ==
20, "");

for (const
auto& child : vecSelfAssign)

{

CC_UNUSED_PARAM(child);

CCASSERT(child->getReferenceCount() ==
2, "");

}

// const at

Vector<Node*> vecConstAt = createVector();

constFunc(vecConstAt);

}

//---------------------------下面是Map的使用-----------------------------------

void TemplateMapTest::onEnter()

{

UnitTestDemo::onEnter();

auto createMap = [this](){

Map<std::string,
Node*> ret;

for (int i =
0; i < 20; ++i)

{

auto node = Node::create();

node->setTag(1000 + i);

ret.insert(StringUtils::toString(i), node);

}

return ret;

};

// Default constructor

Map<std::string,
Node*> map1;

CCASSERT(map1.empty(),
"");

CCASSERT(map1.size() ==
0, "");

CCASSERT(map1.keys().empty(),
"");

CCASSERT(map1.keys(Node::create()).empty(),
"");

// Move constructor

Map<std::string,
Node*> map2 = createMap();

for (const
auto& e : map2)

{

CC_UNUSED_PARAM(e);

CCASSERT(e.second->getReferenceCount() ==
2, "");

}

// Copy constructor

Map<std::string,
Node*> map3(map2);

for (const
auto& e : map3)

{

CC_UNUSED_PARAM(e);

CCASSERT(e.second->getReferenceCount() ==
3, "");

}

// Move assignment operator

Map<std::string,
Node*> map4;

auto unusedNode = Node::create();

map4.insert("unused",unusedNode);

map4 = createMap();

CCASSERT(unusedNode->getReferenceCount() ==
1, "");

for (const
auto& e : map4)

{

CC_UNUSED_PARAM(e);

CCASSERT(e.second->getReferenceCount() ==
2, "");

}

// Copy assignment operator

Map<std::string,
Node*> map5;

map5 = map4;

for (const
auto& e : map5)

{

CC_UNUSED_PARAM(e);

CCASSERT(e.second->getReferenceCount() ==
3, "");

}

// Check size

CCASSERT(map4.size() == map5.size(),
"");

for (const
auto& e : map4)

{

CC_UNUSED_PARAM(e);

CCASSERT(e.second == map5.find(e.first)->second,
"");

}

// bucket_count, bucket_size(n), bucket

log("--------------");

log("bucket_count = %d",
static_cast<int>(map4.bucketCount()));

log("size = %d",
static_cast<int>(map4.size()));

for (int i =
0; i < map4.bucketCount(); ++i)

{

log("bucket_size(%d) = %d", i,
static_cast<int>(map4.bucketSize(i)));

}

for (const
auto& e : map4)

{

log("bucket(\"%s\"), bucket index = %d", e.first.c_str(),
static_cast<int>(map4.bucket(e.first)));

}

log("----- all keys---------");

// keys and at

auto keys = map4.keys();

for (const
auto& key : keys)

{

log("key = %s", key.c_str());

}

auto node10Key = map4.at("10");

map4.insert("100", node10Key);

map4.insert("101", node10Key);

map4.insert("102", node10Key);

log("------ keys for object --------");

auto keysForObject = map4.keys(node10Key);

for (const
auto& key : keysForObject)

{

log("key = %s", key.c_str());

}

log("--------------");

// at in const function

constFunc(map4);

// find

auto nodeToFind = map4.find("10");

CC_UNUSED_PARAM(nodeToFind);

CCASSERT(nodeToFind->second->getTag() ==
1010, "");

// insert

Map<std::string,
Node*> map6;

auto node1 = Node::create();

node1->setTag(101);

auto node2 = Node::create();

node2->setTag(102);

auto node3 = Node::create();

node3->setTag(103);

map6.insert("insert01", node1);

map6.insert("insert02", node2);

map6.insert("insert03", node3);

CCASSERT(node1->getReferenceCount() ==
2, "");

CCASSERT(node2->getReferenceCount() ==
2, "");

CCASSERT(node3->getReferenceCount() ==
2, "");

CCASSERT(map6.at("insert01") == node1,
"");

CCASSERT(map6.at("insert02") == node2,
"");

CCASSERT(map6.at("insert03") == node3,
"");

// erase

Map<std::string,
Node*> mapForErase = createMap();

mapForErase.erase(mapForErase.find("9"));

CCASSERT(mapForErase.find("9") == mapForErase.end(),
"");

CCASSERT(mapForErase.size() ==
19, "");

mapForErase.erase("7");

CCASSERT(mapForErase.find("7") == mapForErase.end(),
"");

CCASSERT(mapForErase.size() ==
18, "");

std::vector<std::string> itemsToRemove;

itemsToRemove.push_back("2");

itemsToRemove.push_back("3");

itemsToRemove.push_back("4");

mapForErase.erase(itemsToRemove);

CCASSERT(mapForErase.size() ==
15, "");

// clear

Map<std::string,
Node*> mapForClear = createMap();

auto mapForClearCopy = mapForClear;

mapForClear.clear();

for (const
auto& e : mapForClearCopy)

{

CC_UNUSED_PARAM(e);

CCASSERT(e.second->getReferenceCount() ==
2, "");

}

// get random object

// Set the seed by time

srand((unsigned)time(nullptr));

Map<std::string,
Node*> mapForRandom = createMap();

log("<--- begin ---->");

for (int i =
0; i < mapForRandom.size(); ++i)

{

log("Map: random object tag = %d", mapForRandom.getRandomObject()->getTag());

}

log("<---- end  ---->");

// Self assignment

Map<std::string,
Node*> mapForSelfAssign = createMap();

mapForSelfAssign = mapForSelfAssign;

CCASSERT(mapForSelfAssign.size() ==
20, "");

for (const
auto& e : mapForSelfAssign)

{

CC_UNUSED_PARAM(e);

CCASSERT(e.second->getReferenceCount() ==
2, "");

}

mapForSelfAssign = std::move(mapForSelfAssign);

CCASSERT(mapForSelfAssign.size() ==
20, "");

for (const
auto& e : mapForSelfAssign)

{

CC_UNUSED_PARAM(e);

CCASSERT(e.second->getReferenceCount() ==
2, "");

}

}

//--------------------------下面是Value的使用,它完毕基本数据类型到对象的包装--------

void ValueTest::onEnter()

{

UnitTestDemo::onEnter();

Value v1;

CCASSERT(v1.getType() ==
Value::Type::NONE,
"");

CCASSERT(v1.isNull(),
"");

Value v2(100);

CCASSERT(v2.getType() ==
Value::Type::INTEGER,
"");

CCASSERT(!v2.isNull(),
"");

Value v3(101.4f);

CCASSERT(v3.getType() ==
Value::Type::FLOAT,
"");

CCASSERT(!v3.isNull(),
"");

Value v4(106.1);

CCASSERT(v4.getType() ==
Value::Type::DOUBLE,
"");

CCASSERT(!v4.isNull(),
"");

unsigned char byte =
50;

Value v5(byte);

CCASSERT(v5.getType() ==
Value::Type::BYTE,
"");

CCASSERT(!v5.isNull(),
"");

Value v6(true);

CCASSERT(v6.getType() ==
Value::Type::BOOLEAN,
"");

CCASSERT(!v6.isNull(),
"");

Value v7("string");

CCASSERT(v7.getType() ==
Value::Type::STRING,
"");

CCASSERT(!v7.isNull(),
"");

Value v8(std::string("string2"));

CCASSERT(v8.getType() ==
Value::Type::STRING,
"");

CCASSERT(!v8.isNull(),
"");

auto createValueVector = [&](){

ValueVector ret;

ret.push_back(v1);

ret.push_back(v2);

ret.push_back(v3);

return ret;

};

Value v9(createValueVector());

CCASSERT(v9.getType() ==
Value::Type::VECTOR,
"");

CCASSERT(!v9.isNull(),
"");

auto createValueMap = [&](){

ValueMap ret;

ret["aaa"] = v1;

ret["bbb"] = v2;

ret["ccc"] = v3;

return ret;

};

Value v10(createValueMap());

CCASSERT(v10.getType() ==
Value::Type::MAP,
"");

CCASSERT(!v10.isNull(),
"");

auto createValueMapIntKey = [&](){

ValueMapIntKey ret;

ret[111] = v1;

ret[222] = v2;

ret[333] = v3;

return ret;

};

Value v11(createValueMapIntKey());

CCASSERT(v11.getType() ==
Value::Type::INT_KEY_MAP,
"");

CCASSERT(!v11.isNull(),
"");

}

----------------------------亲,学会了没----------------------------

版权声明:本文博客原创文章。博客,未经同意,不得转载。

时间: 2024-10-13 05:48:26

Cocos2d-x 3.0final 终结者系列教程12-Vector&amp;map&amp;value的相关文章

Cocos2d-x 3.0final 终结者系列教程23CocosStudio UI组件使用大全Cocos2d-x3.2使用

最近忙死了,得空发表一篇关于所有的Cocostudio中的UI组件使用的教程,其实是对所有UI组件的Api介绍,作为手册收藏下吧!! CocosStudio UI组件 按钮UIButton 复选框UICheckBox 滑块UISlider 图片UIImageView 进度条UILoadingBar 纹理文本 UITextAtlas 字体文本 UIText 图片字体文本 UITextBMFont 文本区域 UITextField 布局组件 UILayout 滚动组件 UIScrollView 页面

Cocos2d-x 3.0final 终结者系列教程12-Vector&amp;map&amp;value

昨天中午北京温度为40度,在中午12:16分我来到篮球场,思考了1分钟决定开站 转球: 我和另外3名队友开始半场, 球传到我手的刹那顿时烫的我持球不稳,顿时问道了淡淡的胶皮味道和烤肉味道的混搭. 这时我来了一个腾空跳投, 球---------爆炸了........ 听新闻说昨天在路上都是 "熟人" 一位老大爷不慎被车刮倒了,大爷二话没说立马爬了起来,围观众人议论纷纷: "大爷人不错","大爷素质真高","大爷身体可真好" 大爷

Cocos2d-x 3.0final 终结者系列教程16-《微信飞机大战》实现

看到cocos2d-x推出了3.1版本,真是每月一次新版本,速度, 还有一个好消息就是http://cn.cocos2d-x.org/上线了,祝贺!啥时候把我的视频和教程放上去呢?!!! 本文介绍一款纵版射击游戏的实现,开发环境: win7 vs2012 cocos2d-x3.0final android adt android ndk r9 首先看下最后的效果: (图1,微信飞机大战运行效果) 源码下载地址:http://download.csdn.net/detail/sdhjob/7513

Cocos2d-x 3.0final 终结者系列教程04-引擎架构分析

从前有个跟我学Android的学生,老是问我: 沈老师,为什么Android中的窗口叫Activity,为什么要在onCreate方法中写setContentView(R.layout.main)? 我说: 你能不能按照我教你的实现一个窗口 第一步在AndroidManifest.xml中添加一个Activity标签 第二步写一个类继承Activity并覆盖onCreate方法 他说: 我想知道为什么要实现Activity和onCreate方法,之后我才能完成这个练习. 我说: 你实现了Acti

Cocos2d-x 3.0final 终结者系列教程09-绘图节点Node中的Schedule

如何让HelloWorld项目中的HelloWorld文字实现自动运动呢? 有的童鞋会想到使用线程,不断修改Label的Position, 这样不行,因为在Cocos2d-x中只能在主线程中来修改Node中的信息,这是由于所有的node都是非线程安全的,如果我们的场景移除了node 在子线程种可能引用错误,所以,要让Node执行特定的变化,需要在当前的Node中使用Schedule 使用方法很简单 1.在当前的HelloWorldScne.h中添加一个方法在HelloWorldScene 如:

Cocos2d-x 3.0final 终结者系列教程10-绘图节点Node中的Action

Action是作用在Node上的逻辑处理,比如让Node移动.旋转.缩放.变色.跳跃.翻转.透明等等,都有相对应的Action Action如何在Node上使用 1.定义Action对象 如 auto act=MoveTo::create(Point(30,0),1); 2.在Node上执行runAction auto sp=Sprite::create("npc.png"); sp->runAction(act); 这样就实现了在sp这个Node上执行移动到30,0这个坐标的动

Cocos2d-x 3.0final 终结者系列教程08-绘图节点Node中的锚点和坐标系

图片问答,(只要回答正确,锚点和坐标系就学会了) 1.下图一共有几个填充为淡黄色的实心矩形? 选择:A,2个  B, 4个 C,1个 D,16个 答案,B,4个 2.下图的4个实心矩形排列在几行几列? 选择:A,1行1列 B,2行2列 答案,B 3.在每个实心矩形外侧都代表了屏幕,并标记了屏幕坐标系,和OpengGL坐标系,请问以下回答哪个正确? A,下图第一列是屏幕坐标系,左上角为0,0点,第二列是OpenGL坐标系,左下角为(0,0)点 B,    文章喜欢马伊琍 C,   黄海波是被陷害的

Cocos2d-x 3.0final 终结者系列教程06-Director和场景跳转

这些天互联网大事不少呀 1.逻辑思维分家(所谓合久必分,分久必合,实属正常,切行切珍惜吧) 2.锤子手机开卖  (不管你买没买,反正我没买,作为多年Android开发的我深知说的亮点其实在我看来都是没用的) 3.京东上市        (一直亏损的企业,在国内上市真的不可能,不过公司亏损不表示公司没有价值,这就是潜力股,奉劝各位找对象的多关注些潜力股) 4.聚美优品上市  (话说欧哥虽是官二代,但互联网电商公司上市跟这确实没啥关系,有本事你是官二代也做个上市公司试试呀, 徐小平老师这次算牛了,投

Cocos2d-x 3.0final 终结者系列教程07-绘图节点Node

在Cocos2d-x中所有能看到的都是引擎调用底层图形库函数绘制完成的, Cocos2d-x将屏幕所有要绘制的所有内容逻辑上保存到一个场景Scene中(尺寸一般会和屏幕大小一致) 而在Scene中又包含了多个图层Layer,每个图层都是一个绘图节点Node. 所以可以理解为所有能在屏幕上显示的对象都是Node类的实例,或Node的子类对象 继承关系是这样的 Node------Scene -------Layer -------Sprite ....... Scene,Layer,Sprite,

Cocos2d-x 3.0final 终结者系列教程15-win7+vs2012+adt+ndk环境搭建(无Cygwin)

终于不用Cygwin 了,很高兴 为什么要用Win7? 因为VS2012要求Win7以上系统才能安装! 为什么要用vs2012? 因为VS2012才支持C++11! 为什么要支持C++11? 因为Cocos2d-x 3.0final版需要C++11的支持. ----------------------------------------------------------- 准备软件都有哪些? Win7,VS2012,Java SDK , ADT(包含了Eclipse,sdk), Android