当前位置: 首页>>代码示例>>C++>>正文


C++ Lisp::get方法代码示例

本文整理汇总了C++中lisp::Lisp::get方法的典型用法代码示例。如果您正苦于以下问题:C++ Lisp::get方法的具体用法?C++ Lisp::get怎么用?C++ Lisp::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lisp::Lisp的用法示例。


在下文中一共展示了Lisp::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: runtime_error

void
Camera::parse(const lisp::Lisp& reader)
{
  std::string modename;
  
  reader.get("mode", modename);
  if(modename == "normal") {
    mode = NORMAL;

    do_backscrolling = true;
    reader.get("backscrolling", do_backscrolling);
  } else if(modename == "autoscroll") {
    mode = AUTOSCROLL;

    const lisp::Lisp* pathLisp = reader.get_lisp("path");
    if(pathLisp == NULL)
      throw std::runtime_error("No path specified in autoscroll camera.");

    autoscroll_path.reset(new Path());
    autoscroll_path->read(*pathLisp);
    autoscroll_walker.reset(new PathWalker(autoscroll_path.get()));
  } else if(modename == "manual") {
    mode = MANUAL;
  } else {
    std::stringstream str;
    str << "invalid camera mode '" << modename << "'found in worldfile.";
    throw std::runtime_error(str.str());
  }
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:29,代码来源:camera.cpp

示例2: reset

void
PlayerStatus::read(const lisp::Lisp& lisp)
{
  reset();
  
  std::string bonusname;
  if(lisp.get("bonus", bonusname)) {
    if(bonusname == "none") {
      bonus = NO_BONUS;
    } else if(bonusname == "growup") {
      bonus = GROWUP_BONUS;
    } else if(bonusname == "fireflower") {
      bonus = FIRE_BONUS;
    } else if(bonusname == "iceflower") {
      bonus = ICE_BONUS;
    } else {
      log_warning << "Unknown bonus '" << bonusname << "' in savefile" << std::endl;
      bonus = NO_BONUS;
    }
  }
  lisp.get("fireflowers", max_fire_bullets);
  lisp.get("iceflowers", max_ice_bullets);

  lisp.get("coins", coins);
  lisp.get("max-score-multiplier", max_score_multiplier);
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:26,代码来源:player_status.cpp

示例3: iter

void
JoystickConfig::read(const lisp::Lisp& joystick_lisp)
{
  joystick_lisp.get("dead-zone", dead_zone);
  joystick_lisp.get("jump-with-up", jump_with_up_joy);

  lisp::ListIterator iter(&joystick_lisp);
  while(iter.next())
  {
    if (iter.item() == "map")
    {
      int button = -1;
      int axis   = 0;
      int hat    = -1;
      std::string control;
      const lisp::Lisp* map = iter.lisp();

      map->get("control", control);
      int i = 0;
      for(i = 0; Controller::controlNames[i] != 0; ++i)
      {
        if (control == Controller::controlNames[i])
          break;
      }

      if (Controller::controlNames[i] == 0)
      {
        log_info << "Invalid control '" << control << "' in buttonmap" << std::endl;
      }
      else
      {
        if (map->get("button", button))
        {
          bind_joybutton(0, button, Controller::Control(i));
        }
        else if (map->get("axis",   axis))
        {
          bind_joyaxis(0, axis, Controller::Control(i));
        }
        else if (map->get("hat",   hat))
        {
          if (hat != SDL_HAT_UP   &&
              hat != SDL_HAT_DOWN &&
              hat != SDL_HAT_LEFT &&
              hat != SDL_HAT_RIGHT) {
            log_info << "Invalid axis '" << axis << "' in axismap" << std::endl;
          }
          else
          {
            bind_joyhat(0, hat, Controller::Control(i));
          }
        }
      }
    }
  }
}
开发者ID:Narre,项目名称:supertux,代码行数:56,代码来源:joystick_config.cpp

示例4: BadGuy

Flame::Flame(const lisp::Lisp& reader)
  : BadGuy(reader, "images/creatures/flame/flame.sprite", LAYER_FLOATINGOBJECTS), angle(0), radius(100), speed(2)
{
  reader.get("radius", radius);
  reader.get("speed", speed);
  bbox.set_pos(Vector(start_position.x + cos(angle) * radius,
                      start_position.y + sin(angle) * radius));
  countMe = false;
  sound_manager->preload(SOUNDFILE);
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:10,代码来源:flame.cpp

示例5: BadGuy

DartTrap::DartTrap(const lisp::Lisp& reader)
	: BadGuy(reader, "images/creatures/darttrap/darttrap.sprite", LAYER_TILES-1), initial_delay(0), fire_delay(2), ammo(-1), state(IDLE)
{
  reader.get("initial-delay", initial_delay);
  reader.get("fire-delay", fire_delay);
  reader.get("ammo", ammo);
  countMe = false;
  sound_manager->preload("sounds/dartfire.wav");
  if (start_dir == AUTO) log_warning << "Setting a DartTrap's direction to AUTO is no good idea" << std::endl;
}
开发者ID:slackstone,项目名称:tuxjunior,代码行数:10,代码来源:darttrap.cpp

示例6: Sector

void
Level::load_old_format(const lisp::Lisp& reader)
{
  reader.get("name", name);
  reader.get("author", author);

  Sector* sector = new Sector(this);
  sector->parse_old_format(reader);
  add_sector(sector);
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:10,代码来源:level.cpp

示例7: mystate

WillOWisp::WillOWisp(const lisp::Lisp& reader)
  : mystate(STATE_IDLE), target_sector("main"), target_spawnpoint("main"), soundSource(0)
{
  reader.get("x", start_position.x);
  reader.get("y", start_position.y);
  reader.get("sector", target_sector);
  reader.get("spawnpoint", target_spawnpoint);

  bbox.set_size(32, 32);  
  sprite = sprite_manager->create("images/creatures/willowisp/willowisp.sprite");
  countMe = false;
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:12,代码来源:willowisp.cpp

示例8: runtime_error

MovingSprite::MovingSprite(const lisp::Lisp& reader, const std::string& sprite_name, int layer, CollisionGroup collision_group)
	: sprite_name(sprite_name), layer(layer)
{
  if (!reader.get("x", bbox.p1.x))
    throw std::runtime_error("no x position set");
  if (!reader.get("y", bbox.p1.y))
    throw std::runtime_error("no y position set");

  sprite = sprite_manager->create(sprite_name);
  bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
  set_group(collision_group);
}
开发者ID:slackstone,项目名称:tuxjunior,代码行数:12,代码来源:moving_sprite.cpp

示例9:

SnowBall::SnowBall(const lisp::Lisp& reader)
{
  reader.get("x", start_position.x);
  reader.get("y", start_position.y);
  //This is for a hidden badguy :)
  fluffy = false;  
  reader.get("fluffy",fluffy);
  bbox.set_size(31.8, 31.8);
  if (fluffy) sprite = sprite_manager->create("images/creatures/fluffy/fluffy.sprite");
  else sprite = sprite_manager->create("images/creatures/snowball/snowball.sprite");
  set_direction = false;
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:12,代码来源:snowball.cpp

示例10: BadGuy

Dispenser::Dispenser(const lisp::Lisp& reader)
	: BadGuy(reader, "images/creatures/dispenser/dispenser.sprite")
{
  reader.get("cycle", cycle);
  reader.get("badguy", badguy);
  if (badguy == "mrrocket") {
     if (start_dir == AUTO) log_warning << "Setting a Dispenser's direction to AUTO is no good idea" << std::endl;
     sprite->set_action(dir == LEFT ? "working-left" : "working-right");
  }
  else {sprite->set_action("dropper");}
  bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
  countMe = false;
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:13,代码来源:dispenser.cpp

示例11:

PowerUp::PowerUp(const lisp::Lisp& lisp)
{
  lisp.get("x", bbox.p1.x);
  lisp.get("y", bbox.p1.y);
  lisp.get("sprite", sprite_name);
  lisp.get("script", script);
  no_physics = false;
  lisp.get("disable-physics", no_physics);
  bbox.set_size(32, 32);   
  sprite = sprite_manager->create(sprite_name);
  physic.enable_gravity(true);

  set_group(COLGROUP_MOVING);
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:14,代码来源:powerup.cpp

示例12:

Spiky::Spiky(const lisp::Lisp& reader)
{
  reader.get("x", start_position.x);
  reader.get("y", start_position.y);
  bbox.set_size(31.8, 31.8);
  sprite = sprite_manager->create("images/creatures/spiky/spiky.sprite");
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:7,代码来源:spiky.cpp

示例13:

MrBomb::MrBomb(const lisp::Lisp& reader)
{
  reader.get("x", start_position.x);
  reader.get("y", start_position.y);
  bbox.set_size(31.8, 31.8);
  sprite = sprite_manager->create("images/creatures/mr_bomb/mr_bomb.sprite");
  set_direction = false;
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:8,代码来源:mrbomb.cpp

示例14:

SpiderMite::SpiderMite(const lisp::Lisp& reader)
{
  reader.get("x", start_position.x);
  reader.get("y", start_position.y);
  bbox.set_size(31.8, 31.8);
  sprite = sprite_manager->create("images/creatures/spidermite/spidermite.sprite");
  physic.enable_gravity(false);
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:8,代码来源:spidermite.cpp

示例15:

Fish::Fish(const lisp::Lisp& reader)
{
  reader.get("x", start_position.x);
  reader.get("y", start_position.y);
  bbox.set_size(31.8, 31.8);
  sprite = sprite_manager->create("images/creatures/fish/fish.sprite");
  physic.enable_gravity(true);
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:8,代码来源:fish.cpp


注:本文中的lisp::Lisp::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。