本文整理汇总了C++中lisp::Writer::end_list方法的典型用法代码示例。如果您正苦于以下问题:C++ Writer::end_list方法的具体用法?C++ Writer::end_list怎么用?C++ Writer::end_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lisp::Writer
的用法示例。
在下文中一共展示了Writer::end_list方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
GhostParticleSystem::write(lisp::Writer& writer)
{
writer.start_list("particles-ghosts");
writer.write_int("z-pos", z_pos);
writer.end_list("particles-ghosts");
}
示例2:
void
Sector::write(lisp::Writer& writer)
{
writer.write_string("name", name);
writer.write_float("gravity", gravity);
writer.write_string("music", music);
// write spawnpoints
for(SpawnPoints::iterator i = spawnpoints.begin(); i != spawnpoints.end();
++i) {
SpawnPoint* spawn = *i;
writer.start_list("spawn-points");
writer.write_string("name", spawn->name);
writer.write_float("x", spawn->pos.x);
writer.write_float("y", spawn->pos.y);
writer.end_list("spawn-points");
}
// write objects
for(GameObjects::iterator i = gameobjects.begin();
i != gameobjects.end(); ++i) {
Serializable* serializable = dynamic_cast<Serializable*> (*i);
if(serializable)
serializable->write(writer);
}
}
示例3:
void
SSpiky::write(lisp::Writer& writer)
{
writer.start_list("sspiky");
WalkingBadguy::write(writer);
writer.end_list("sspiky");
}
示例4:
void
Stumpy::write(lisp::Writer& writer)
{
writer.start_list("stumpy");
WalkingBadguy::write(writer);
writer.end_list("stumpy");
}
示例5:
void
MrTree::write(lisp::Writer& writer)
{
writer.start_list("mrtree");
WalkingBadguy::write(writer);
writer.end_list("mrtree");
}
示例6:
void
MrIceBlock::write(lisp::Writer& writer)
{
writer.start_list("mriceblock");
WalkingBadguy::write(writer);
writer.end_list("mriceblock");
}
示例7: save_squirrel_table
void save_squirrel_table(HSQUIRRELVM vm, int table_idx, lisp::Writer& writer)
{
// offset because of sq_pushnull
if(table_idx < 0)
table_idx -= 1;
//iterator table
sq_pushnull(vm);
while(SQ_SUCCEEDED(sq_next(vm, table_idx))) {
if(sq_gettype(vm, -2) != OT_STRING) {
std::cerr << "Table contains non-string key\n";
continue;
}
const char* key;
sq_getstring(vm, -2, &key);
switch(sq_gettype(vm, -1)) {
case OT_INTEGER: {
int val;
sq_getinteger(vm, -1, &val);
writer.write_int(key, val);
break;
}
case OT_FLOAT: {
float val;
sq_getfloat(vm, -1, &val);
writer.write_float(key, val);
break;
}
case OT_BOOL: {
SQBool val;
sq_getbool(vm, -1, &val);
writer.write_bool(key, val);
break;
}
case OT_STRING: {
const char* str;
sq_getstring(vm, -1, &str);
writer.write_string(key, str);
break;
}
case OT_TABLE: {
writer.start_list(key, true);
save_squirrel_table(vm, -1, writer);
writer.end_list(key);
break;
}
case OT_CLOSURE:
break; // ignore
case OT_NATIVECLOSURE:
break;
default:
std::cerr << "Can't serialize key '" << key << "' in table.\n";
break;
}
sq_pop(vm, 2);
}
sq_pop(vm, 1);
}
示例8:
void
Dart::write(lisp::Writer& writer)
{
writer.start_list("dart");
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
writer.end_list("dart");
}
示例9:
void
MoleRock::write(lisp::Writer& writer)
{
writer.start_list("mole_rock");
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
writer.end_list("mole_rock");
}
示例10:
void
Yeti::write(lisp::Writer& writer)
{
writer.start_list("yeti");
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
writer.end_list("yeti");
}
示例11:
void
MrBomb::write(lisp::Writer& writer)
{
writer.start_list("mrbomb");
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
writer.end_list("mrbomb");
}
示例12:
void
SpawnPoint::save(lisp::Writer& writer){
writer.start_list("spawnpoint");
writer.write("x",pos.x);
writer.write("y",pos.y);
writer.write("name",name,false);
writer.end_list("spawnpoint");
}
示例13:
void
MrRocket::write(lisp::Writer& writer)
{
writer.start_list("mrrocket");
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
writer.end_list("mrrocket");
}
示例14:
void
SnowSnail::write(lisp::Writer& writer)
{
writer.start_list("mriceblock");
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
writer.end_list("snowsnail");
}
示例15:
void
Zeekling::write(lisp::Writer& writer)
{
writer.start_list("zeekling");
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
writer.end_list("zeekling");
}