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


C++ TCODZip::getInt方法代码示例

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


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

示例1: load

void Map::load(TCODZip &zip) {
  seed=zip.getInt();
  init(false);
  for (int i=0; i < width*height; i++) {
    tiles[i].explored=zip.getInt();
  }
}
开发者ID:alec-parks,项目名称:rlTutorial,代码行数:7,代码来源:Map.cpp

示例2: load

void Engine::load()
{
	TCODZip zip;
	zip.loadFromFile("game.sav");
	//load the map
	int width=zip.getInt();
	int height=zip.getInt();
	map = new Map(width,height);
	map->load(zip);
	//then the player
	player=new Actor(0,0,0,NULL,TCODColor::white);
	player->load(zip);
	map->actors.push(player);
	// the stairs
	stairs=new Actor(0,0,0,NULL,TCODColor::white);
	stairs->load(zip);
	map->actors.push(stairs);
	map->sendToBack(stairs);
	//then all other actors
	int nbActors=zip.getInt();
	while (nbActors > 0)
	{
		Actor *actor = new Actor(0,0,0,NULL,TCODColor::white);
		actor->load(zip);
		map->actors.push(actor);
		map->sendToBack(actor);
		nbActors--;
	}
	//finally the message log
	topGui->load(zip);
}
开发者ID:PeterMRegan,项目名称:CS1310,代码行数:31,代码来源:Engine.cpp

示例3: load

void Confuser::load(TCODZip &zip) {
	nbTurns = zip.getInt();
	range = zip.getFloat();
	stacks = zip.getInt();
	stackSize = zip.getInt();
	value = zip.getInt();
}
开发者ID:cottog,项目名称:CASTER-EDITION,代码行数:7,代码来源:Pickable.cpp

示例4: load

void Engine::load(){
  if ( TCODSystem::fileExists("game.sav")) {
    TCODZip zip;
    zip.loadFromFile("game.sav");
    //load map
    int width = zip.getInt();
    int height = zip.getInt();
    map = new Map(width,height);
    map->load(zip);
    //Player
    player = new Actor(0,0,0,NULL,TCODColor::white);
    player->load(zip);
    actors.push(player);
    //All other Actors
    int nbActors=zip.getInt();
    while (nbActors > 0) {
      Actor *actor = new Actor(0,0,0,NULL,TCODColor::white);
      actor->load(zip);
      actors.push(actor);
      nbActors--;
    }
    //Last - Logs
    gui->load(zip);
  } else {
    engine.init();
  }
}
开发者ID:alec-parks,项目名称:rlTutorial,代码行数:27,代码来源:Persistent.cpp

示例5: Load

void Map::Load(TCODZip &zip)
{
    seed_=zip.getInt();
    Init(false);
    for (int32_t i = 0; i < width_ * height_; i++) {
        tiles_[i].explored_ = zip.getInt();
    }
}
开发者ID:dev-riker,项目名称:roguelikes,代码行数:8,代码来源:persistent.cpp

示例6: load

void Destructible::load(TCODZip &zip) {
	maxHp = zip.getFloat();
	hp = zip.getFloat();
	defense = zip.getFloat();
	corpseName = _strdup(zip.getString());
	maxAp = zip.getInt();
	ap = zip.getInt();
}
开发者ID:netsphereengineer,项目名称:knavereboot,代码行数:8,代码来源:Destructible.cpp

示例7: Init

void
Map::Load(TCODZip& zip) {
    seed = zip.getInt();

    Init(false);

    for(int i = 0; i < width * height; ++i) {
        tiles[i].explored = (zip.getInt() != 0);
    }
}
开发者ID:ctmartinez1992,项目名称:Blood-Arena,代码行数:10,代码来源:Persistent.cpp

示例8: load

void Pickable::load(TCODZip &zip){
    bool hasTargetSelector = zip.getInt();
    bool hasEffect = zip.getInt();
    if(hasTargetSelector){
        selector = new TargetSelector(TargetSelector::CLOSEST_MONSTER,0);
        selector->load(zip);
    }
    if(hasEffect){
        effect = Effect::create(zip);
    }
}
开发者ID:pthurston,项目名称:Roguelike-Game-Engine,代码行数:11,代码来源:Pickable.cpp

示例9: Container

void
Actor::Load(TCODZip& zip) {
    x = zip.getInt();
    y = zip.getInt();

    code = zip.getInt();
    color = zip.getColor();

    name = _strdup(zip.getString());

	blocks = zip.getInt() != 0;
	fovOnly = zip.getInt() != 0;

	bool hasDestructible = (zip.getInt() != 0);
	bool hasAi = (zip.getInt() != 0);
	bool hasPickable = (zip.getInt() != 0);
	bool hasContainer = (zip.getInt() != 0);

    if(hasDestructible) {
        destructible = Destructible::Create(zip);
    }

    if(hasAi) {
        ai = Ai::Create(zip);
    }

    if(hasPickable) {
        pickable = Pickable::Create(zip);
    }

    if(hasContainer) {
        container = new Container(0);
        container->Load(zip);
    }
}
开发者ID:ctmartinez1992,项目名称:Blood-Arena,代码行数:35,代码来源:Persistent.cpp

示例10: while

void
Container::Load(TCODZip& zip) {
    size = zip.getInt();
    int numberOfallActors = zip.getInt();

    while(numberOfallActors > 0) {
        Actor* actor = new Actor(0, 0);
        actor->Load(zip);

        inventory.push(actor);

        numberOfallActors--;
    }
}
开发者ID:ctmartinez1992,项目名称:Blood-Arena,代码行数:14,代码来源:Persistent.cpp

示例11: load

void Actor::load(TCODZip &zip) {
	x = zip.getInt();
	y = zip.getInt();
	ch = zip.getInt();
	col= zip.getColor();
	name = strdup(zip.getString());
	blocks = zip.getInt();
	bool hasAttacker = zip.getInt();
	bool hasDestructible = zip.getInt();
	bool hasAi = zip.getInt();
	bool hasPickable = zip.getInt();
	bool hasContainer = zip.getInt();
	
	if (hasAttacker) {
		attacker = new Attacker(0.0f);
		attacker->load(zip);
	}
	if (hasDestructible) {
		destructible = Destructible::create(zip);
	}
	if (hasAi) {
		ai = Ai::create(zip);
	}
	if (hasPickable) {
		pickable = Pickable::create(zip);
	}
	if (hasContainer) {
		container = new Container(0);
		container->load(zip);
	}
}
开发者ID:cottog,项目名称:Game,代码行数:31,代码来源:Actor.cpp

示例12: load

void Map::load(TCODZip &zip, NodeType type){
    seed = zip.getInt();
    init(false);
    for(int i = 0; i < width * height; i++){
        tiles[i].explored = zip.getInt();
        //tiles[i].walkable = zip.getInt();
        //tiles[i].inFOV = zip.getInt();
    }

    int nbActors = zip.getInt();
    while(nbActors > 0){
        Actor *actor = new Actor(0, 0, 0, NULL, TCODColor::white);
        actor->load(zip);
        actors.push(actor);
        nbActors--;
    }

    bool hasNextLevel = zip.getInt();
    bool hasPrevLevel = zip.getInt();

    if(hasNextLevel && (type == ROOT || type == BELOW_ROOT)){
        int newWidth = zip.getInt();
        int newHeight = zip.getInt();
        nextLevel = new Map(newWidth, newHeight, NULL, this);
        nextLevel->load(zip, BELOW_ROOT);
    }
    if(hasPrevLevel && (type == ROOT || type == ABOVE_ROOT)){
        int newWidth = zip.getInt();
        int newHeight = zip.getInt();
        prevLevel = new Map(newWidth, newHeight, this, NULL);
        prevLevel->load(zip, ABOVE_ROOT);
    }
}
开发者ID:pthurston,项目名称:Roguelike-Game-Engine,代码行数:33,代码来源:Map.cpp

示例13: Load

void clBuilding::Load(TCODZip &file,VecLoad &bonusdata)
{
     mytile=GetFromLoad(file.getInt(),bonusdata);
    if(mytile==NULL)
        throw "Error loading file";
    int bid=file.getInt();
    t=BTManager::Get().GetTemplate((BuildingID)bid);
    if(t==NULL)
        throw "Error loading building template";
    mypic=file.getInt();
    data=file.getInt();
    int matid=file.getInt();
    mat=MaterialManager::Get().GetMaterial(MATT_ALL,matid);
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例14: load

void Destructible::load(TCODZip &zip)
{
    maxHp = zip.getFloat();
    hp = zip.getFloat();
    defense = zip.getFloat();
    isImmortal = zip.getInt();
    corpseName = strdup(zip.getString());
}
开发者ID:seejessicacode,项目名称:Libtcod-Experiments,代码行数:8,代码来源:Destructible.cpp

示例15: load

void Destructible::load(TCODZip &zip) {
	maxHp = zip.getFloat();
	hp = zip.getFloat();
	baseDefense = zip.getFloat();
	totalDefense = zip.getFloat();
	corpseName = strdup(zip.getString());
	xp = zip.getInt();
}
开发者ID:cottog,项目名称:Game,代码行数:8,代码来源:Destructible.cpp


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