本文整理汇总了C++中node::end方法的典型用法代码示例。如果您正苦于以下问题:C++ node::end方法的具体用法?C++ node::end怎么用?C++ node::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类node
的用法示例。
在下文中一共展示了node::end方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
maplayer::maplayer(node source)
{
node tilesrc = nx::nodes["Map"]["Tile"][source["info"]["tS"] + ".img"];
node objsrc = nx::nodes["Map"]["Obj"];
for (node layernode = source.begin(); layernode != source.end(); layernode++)
{
if (layernode.name() == "obj")
{
for (node objnode = layernode.begin(); objnode != layernode.end(); ++objnode)
{
vector2d position = vector2d(objnode["x"], objnode["y"]);
node bmpnode = objsrc[objnode["oS"] + ".img"][objnode["l0"]][objnode["l1"]][objnode["l2"]];
int z = objnode["z"];
objs[z].push_back(sprite(animation(bmpnode), position, true, objnode.resolve("f").get_bool()));
}
}
else if (layernode.name() == "tile")
{
for (node tilenode = layernode.begin(); tilenode != layernode.end(); ++tilenode)
{
node bmpnode = tilesrc[tilenode["u"]][to_string(tilenode["no"].get_integer())];
tile toadd;
toadd.pos = vector2d(tilenode["x"], tilenode["y"]);
toadd.txt = texture(bmpnode);
int z = bmpnode["z"].istype(integernode) ? bmpnode["z"] : tilenode["zM"];
tiles[z].push_back(toadd);
}
}
}
}
示例2: texture
charset::charset(node src)
{
for (node sub = src.begin(); sub != src.end(); sub++)
{
char c = sub.name()[0];
if (c == '\\')
c = '/';
characters[c] = texture(sub);
}
}
示例3: Texture
Charset::Charset(node src, CharsetAlignment alg)
{
for (node sub = src.begin(); sub != src.end(); ++sub)
{
if (sub.data_type() == node::type::bitmap)
{
int8_t c = sub.name()[0];
if (c == '\\')
{
c = '/';
}
chars.add(c, new Texture(sub));
}
}
alignment = alg;
}
示例4:
mapbackgrounds::mapbackgrounds(node bgnodes, vector2d mapwalls, vector2d mapborders)
{
node back = nx::nodes["Back"]["Back"];
for (node backnode = bgnodes.begin(); backnode != bgnodes.end(); ++backnode)
{
if (!backnode["bS"].get_string().empty())
{
if (backnode["front"].get_bool())
{
foregrounds.push_back(background(backnode, back, mapwalls, mapborders));
}
else
{
backgrounds.push_back(background(backnode, back, mapwalls, mapborders));
}
}
}
}
示例5: if
footholdtree::footholdtree(node source)
{
for (node basef = source.begin(); basef != source.end(); ++basef)
{
for (node midf = basef.begin(); midf != basef.end(); ++midf)
{
map<short, short> platform;
for (node lastf = midf.begin(); lastf != midf.end(); ++lastf)
{
short id = static_cast<short>(stoi(lastf.name()));
footholds[id] = struct foothold();
footholds[id].id = id;
footholds[id].prev = static_cast<short>(lastf["prev"]);
footholds[id].next = static_cast<short>(lastf["next"]);
footholds[id].horizontal = vector2d(static_cast<int>(lastf["x1"]), static_cast<int>(lastf["x2"]));
footholds[id].vertical = vector2d(static_cast<int>(lastf["y1"]), static_cast<int>(lastf["y2"]));
if (footholds[id].prev == 0)
{
edgesl.push_back(id);
}
else if (footholds[id].next == 0)
{
edgesr.push_back(id);
}
/*if (footholds[id].isfloor())
{
short y = footholds[id].vertical.x();
for (short i = footholds[id].horizontal.x(); i <= footholds[id].horizontal.y(); i++)
{
platform[i] = y;
}
}
else
{
vector2d slope = footholds[id].vertical;
short distance = footholds[id].horizontal.y() - footholds[id].horizontal.x();
if (slope.x() > slope.y())
{
float step = static_cast<float>((slope.x() - slope.y())) / distance;
for (short i = footholds[id].horizontal.x(); i <= footholds[id].horizontal.y(); i++)
{
platform[i] = slope.x() - static_cast<int>(i * step);
}
}
else
{
float step = static_cast<float>((slope.y() - slope.x())) / distance;
for (short i = footholds[id].horizontal.x(); i <= footholds[id].horizontal.y(); i++)
{
platform[i] = slope.x() + static_cast<int>(i * step);
}
}
}*/
}
platforms.push_back(platform);
}
}
lowestg = -65536;
for (vector<map<short, short>>::iterator pfit = platforms.begin(); pfit != platforms.end(); ++pfit)
{
for (map<short, short>::iterator yit = pfit->begin(); yit != pfit->end(); ++yit)
{
if (yit->second > lowestg)
{
lowestg = yit->second;
}
}
}
}
示例6: if
Footholdtree::Footholdtree(node src)
{
for (node basef = src.begin(); basef != src.end(); ++basef)
{
int8_t layer = static_cast<int8_t>(stoi(basef.name()));
for (node midf = basef.begin(); midf != basef.end(); ++midf)
{
for (node lastf = midf.begin(); lastf != midf.end(); ++lastf)
{
uint16_t id = stoi(lastf.name());
footholds[id] = Foothold(id, layer, lastf);
if (footholds[id].getprev() == 0)
{
edgesl.push_back(id);
}
else if (footholds[id].getnext() == 0)
{
edgesr.push_back(id);
}
}
}
}
int32_t leftw = 65536;
for (vector<uint16_t>::iterator fhit = edgesl.begin(); fhit != edgesl.end(); ++fhit)
{
int32_t lit = footholds[*fhit].getl();
if (lit < leftw)
{
leftw = lit;
}
}
int32_t rightw = -65536;
for (vector<uint16_t>::iterator fhit = edgesr.begin(); fhit != edgesr.end(); ++fhit)
{
int32_t rit = footholds[*fhit].getr();
if (rit > rightw)
{
rightw = rit;
}
}
walls = vector2d<int32_t>(leftw + 25, rightw - 25);
int32_t botb = -65536;
for (map<uint16_t, Foothold>::iterator fhit = footholds.begin(); fhit != footholds.end(); ++fhit)
{
int32_t btit = fhit->second.getb();
if (btit > botb)
{
botb = btit;
}
}
int32_t topb = 65536;
for (map<uint16_t, Foothold>::iterator fhit = footholds.begin(); fhit != footholds.end(); ++fhit)
{
int32_t tpit = fhit->second.gett();
if (tpit < topb)
{
topb = tpit;
}
}
borders = vector2d<int32_t>(topb - 400, botb + 400);
}