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


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

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


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

示例1: Save

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

示例2: save

void Aura::save(TCODZip &zip) {
	zip.putInt(stat);
	zip.putInt(totalDuration);
	zip.putInt(duration);
	zip.putInt(bonus);
	zip.putInt(life);
}
开发者ID:cottog,项目名称:CASTER-EDITION,代码行数:7,代码来源:Aura.cpp

示例3: save

void Healer::save(TCODZip &zip) {
	zip.putInt(type);
	zip.putFloat(amount);
	zip.putInt(stacks);
	zip.putInt(stackSize);
	zip.putInt(value);
}
开发者ID:cottog,项目名称:CASTER-EDITION,代码行数:7,代码来源:Pickable.cpp

示例4:

void
Engine::Save() {
	if(player->destructible->IsDead()) {
		TCODSystem::deleteFile("game.sav");
	}
	else {
		TCODZip zip;

		zip.putInt(SAVEGAME_VERSION);

		zip.putInt(map->width);
		zip.putInt(map->height);
		map->Save(zip);

		player->Save(zip);

		zip.putInt(allActors.size() - 2);

		for(Actor** it = allActors.begin(); it != allActors.end(); ++it) {
			if(*it != player) {
				(*it)->Save(zip);
			}
		}

		gui->Save(zip);

		zip.saveToFile("game.sav");
	}
}
开发者ID:ctmartinez1992,项目名称:Blood-Arena,代码行数:29,代码来源:Persistent.cpp

示例5: save

void Engine::save()
{
	if (player->destructible->isDead())
	{
		TCODSystem::deleteFile("game.sav");
	}
	else
	{
		TCODZip zip;
		//save the map first
		zip.putInt(map->width);
		zip.putInt(map->height);
		map->save(zip);
		//then the player
		player->save(zip);
		//then the stairs
		stairs->save(zip);
		//then all the other actors
		zip.putInt(map->actors.size()-2);
		for (Actor **i=map->actors.begin(); i!=map->actors.end(); i++)
		{
			if (*i!=player && *i!=stairs)
			{
				(*i)->save(zip);
			}
		}
		// finally the message log
		topGui->save(zip);
		zip.saveToFile("game.sav");
	}
}
开发者ID:PeterMRegan,项目名称:CS1310,代码行数:31,代码来源:Engine.cpp

示例6: save

void ConfusedMonsterAi::save(TCODZip &zip)
{
    zip.putInt(CONFUSED_MONSTER);
    zip.putInt(nbTurns);
    oldAi->save(zip);
    zip.putColor(&oldColor);
}
开发者ID:seejessicacode,项目名称:Libtcod-Experiments,代码行数:7,代码来源:Ai.cpp

示例7: save

void Destructible::save(TCODZip &zip) {
	zip.putFloat(maxHp);
	zip.putFloat(hp);
	zip.putFloat(defense);
	zip.putString(corpseName);
	zip.putInt(maxAp);
	zip.putInt(ap);
}
开发者ID:netsphereengineer,项目名称:knavereboot,代码行数:8,代码来源:Destructible.cpp

示例8: save

void Pickable::save(TCODZip &zip){
    zip.putInt(selector != NULL);
    zip.putInt(effect != NULL);
    if(selector)
        selector->save(zip);
    if(effect)
        effect->save(zip);
}
开发者ID:pthurston,项目名称:Roguelike-Game-Engine,代码行数:8,代码来源:Pickable.cpp

示例9: Save

void clBuilding::Save(TCODZip &file)
{
    file.putChar(CL_BUILDING);
    file.putInt(mytile->GetSave()->num);
    file.putInt(t->GetBuildingID());
    file.putInt(mypic);
    file.putInt(data);
    file.putInt(mat->ID);
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例10: save

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

    zip.putInt(actors.size());
    for(Actor **it = actors.begin(); it != actors.end(); it++){
        (*it)->save(zip);
    }

    zip.putInt(nextLevel != NULL);
    zip.putInt(prevLevel != NULL);

    if(nextLevel && (type == ROOT || type == BELOW_ROOT)){
        zip.putInt(nextLevel->width);
        zip.putInt(nextLevel->height);
        nextLevel->save(zip, BELOW_ROOT);
    }
    if(prevLevel && (type == ROOT || type == ABOVE_ROOT)){
        zip.putInt(prevLevel->width);
        zip.putInt(prevLevel->height);
        prevLevel->save(zip, ABOVE_ROOT);
    }
}
开发者ID:pthurston,项目名称:Roguelike-Game-Engine,代码行数:27,代码来源:Map.cpp

示例11: save

void Gui::save(TCODZip &zip) {
	zip.putInt(log.size());
	for (Message **it = log.begin(); it != log.end(); it++) {
		zip.putString((*it)->text);
		zip.putColor(&(*it)->col);
	}
}
开发者ID:cottog,项目名称:CASTER-EDITION,代码行数:7,代码来源:Gui.cpp

示例12: save

void Destructible::save(TCODZip &zip) {
	zip.putFloat(maxHp);
	zip.putFloat(hp);
	zip.putFloat(baseDefense);
	zip.putFloat(totalDefense);
	zip.putString(corpseName);
	zip.putInt(xp);
}
开发者ID:cottog,项目名称:Game,代码行数:8,代码来源:Destructible.cpp

示例13: save

void Engine::save() {
  if (player->destructible->isDead() ){
    TCODSystem::deleteFile("game.sav");
  }else {
    TCODZip zip;
    //save the map
    zip.putInt(map->width);
    zip.putInt(map->height);
    map->save(zip);
    //then the player
    player->save(zip);
    //All the other actors
    zip.putInt(actors.size()-1);
    for (Actor **iterator=actors.begin(); iterator!=actors.end();
           iterator++){
      if(*iterator != player){
        (*iterator)->save(zip);
      }
    }
    //Save the logs
    gui->save(zip);
    zip.saveToFile("game.sav");
  }
}
开发者ID:alec-parks,项目名称:rlTutorial,代码行数:24,代码来源:Persistent.cpp

示例14: save

void Actor::save(TCODZip &zip) {
	zip.putInt(x);
	zip.putInt(y);
	zip.putInt(ch);
	zip.putColor(&col);
	zip.putString(name);
	zip.putInt(blocks);
	zip.putInt(attacker != NULL);
	zip.putInt(destructible != NULL);
	zip.putInt(ai != NULL);
	zip.putInt(pickable != NULL);
	zip.putInt(container != NULL);
	
	if (attacker) attacker->save(zip);
	if (destructible) destructible->save(zip);
	if (ai) ai->save(zip);
	if (pickable) pickable->save(zip);
	if (container) container->save(zip);
}
开发者ID:cottog,项目名称:Game,代码行数:19,代码来源:Actor.cpp

示例15: save

void LightningBolt::save(TCODZip &zip)
{
	zip.putInt(LIGHTNING_BOLT);
	zip.putFloat(range);
	zip.putFloat(damage);
}
开发者ID:PeterMRegan,项目名称:CS1310,代码行数:6,代码来源:Scroll.cpp


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