本文整理汇总了C++中mapextras::MapCache::baseMaterialAt方法的典型用法代码示例。如果您正苦于以下问题:C++ MapCache::baseMaterialAt方法的具体用法?C++ MapCache::baseMaterialAt怎么用?C++ MapCache::baseMaterialAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mapextras::MapCache
的用法示例。
在下文中一共展示了MapCache::baseMaterialAt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: colorTile
void colorTile(const df::tiletype_material& tileMat,MapExtras::MapCache& cache,const DFCoord& pos,screenTile& trg,bool isUndug=false)
{
t_matpair mat;
switch(tileMat)
{
case df::tiletype_material::ASHES:
trg.fg=COLOR_GREY;
trg.bold=false;
break;
case df::tiletype_material::CAMPFIRE:
trg.fg=COLOR_YELLOW;
trg.bold=true;
break;
case df::tiletype_material::SOIL:
mat=cache.baseMaterialAt(pos);
{
df::material* m=lookupMaterial(mat,trg);
if(m && isUndug)
{
trg.tile=m->tile;
}
break;
}
case df::tiletype_material::STONE:
case df::tiletype_material::LAVA_STONE:
mat=cache.baseMaterialAt(pos);
lookupMaterial(mat,trg);
break;
case df::tiletype_material::CONSTRUCTION:
mat=cache.staticMaterialAt(pos);
lookupMaterial(mat,trg,true);
break;
case df::tiletype_material::MINERAL:
mat.mat_index=cache.veinMaterialAt(pos);
mat.mat_type=0;//inorganic
{
df::material* m=lookupMaterial(mat,trg);
if(m && isUndug)
{
trg.tile=m->tile;
}
}
break;
case df::tiletype_material::FROZEN_LIQUID:
trg.fg=COLOR_CYAN;
trg.bold=true;
break;
case df::tiletype_material::PLANT:
case df::tiletype_material::GRASS_LIGHT: //MORE INFO IN MAP BLOCK EVENTS
trg.fg=COLOR_GREEN;
trg.bold=true;
break;
case df::tiletype_material::GRASS_DARK:
trg.fg=COLOR_GREEN;
trg.bold=false;
break;
case df::tiletype_material::GRASS_DRY:
trg.fg=COLOR_YELLOW;
trg.bold=true;
break;
case df::tiletype_material::GRASS_DEAD:
trg.fg=COLOR_BROWN;
trg.bold=false;
break;
case df::tiletype_material::DRIFTWOOD:
trg.fg=COLOR_WHITE;
trg.bold=true;
break;
case df::tiletype_material::MAGMA:
trg.fg=COLOR_RED;
trg.bold=true;
break;
case df::tiletype_material::POOL:
case df::tiletype_material::RIVER:
case df::tiletype_material::BROOK:
trg.fg=COLOR_BROWN;
trg.bold=false;
break;
}
}
示例2: df_probe
//.........这里部分代码省略.........
// biome, geolayer
out << "biome: " << des.bits.biome << " (" <<
"region id=" << biome->region_id << ", " <<
surroundings[surr] << ", " <<
"savagery " << biome->savagery << ", " <<
"evilness " << biome->evilness << ")" << std::endl;
out << "geolayer: " << des.bits.geolayer_index
<< std::endl;
int16_t base_rock = mc.layerMaterialAt(cursor);
if(base_rock != -1)
{
out << "Layer material: " << dec << base_rock;
if(hasmats)
out << " / " << inorganic[base_rock].id
<< " / "
<< inorganic[base_rock].name
<< endl;
else
out << endl;
}
int16_t vein_rock = mc.veinMaterialAt(cursor);
if(vein_rock != -1)
{
out << "Vein material (final): " << dec << vein_rock;
if(hasmats)
out << " / " << inorganic[vein_rock].id
<< " / "
<< inorganic[vein_rock].name
<< endl;
else
out << endl;
}
MaterialInfo minfo(mc.baseMaterialAt(cursor));
if (minfo.isValid())
out << "Base material: " << minfo.getToken() << " / " << minfo.toString() << endl;
minfo.decode(mc.staticMaterialAt(cursor));
if (minfo.isValid())
out << "Static material: " << minfo.getToken() << " / " << minfo.toString() << endl;
// liquids
if(des.bits.flow_size)
{
if(des.bits.liquid_type == tile_liquid::Magma)
out <<"magma: ";
else out <<"water: ";
out << des.bits.flow_size << std::endl;
}
if(des.bits.flow_forbid)
out << "flow forbid" << std::endl;
if(des.bits.pile)
out << "stockpile?" << std::endl;
if(des.bits.rained)
out << "rained?" << std::endl;
if(des.bits.smooth)
out << "smooth?" << std::endl;
if(des.bits.water_salt)
out << "salty" << endl;
if(des.bits.water_stagnant)
out << "stagnant" << endl;
#define PRINT_FLAG( FIELD, BIT ) out.print("%-16s= %c\n", #BIT , ( FIELD.bits.BIT ? 'Y' : ' ' ) )
PRINT_FLAG( des, hidden );
PRINT_FLAG( des, light );
PRINT_FLAG( des, outside );
PRINT_FLAG( des, subterranean );
PRINT_FLAG( des, water_table );
示例3: df_probe
//.........这里部分代码省略.........
con.print("\n\n");
}
*/
// tiletype
con.print("tiletype: %d", tiletype);
if(tileName(tiletype))
con.print(" = %s",tileName(tiletype));
con.print("\n");
df::tiletype_shape shape = tileShape(tiletype);
df::tiletype_material material = tileMaterial(tiletype);
df::tiletype_special special = tileSpecial(tiletype);
df::tiletype_variant variant = tileVariant(tiletype);
con.print("%-10s: %4d %s\n","Class" ,shape,
ENUM_KEY_STR(tiletype_shape, shape));
con.print("%-10s: %4d %s\n","Material" ,
material, ENUM_KEY_STR(tiletype_material, material));
con.print("%-10s: %4d %s\n","Special" ,
special, ENUM_KEY_STR(tiletype_special, special));
con.print("%-10s: %4d %s\n" ,"Variant" ,
variant, ENUM_KEY_STR(tiletype_variant, variant));
con.print("%-10s: %s\n" ,"Direction",
tileDirection(tiletype).getStr());
con.print("\n");
con.print("temperature1: %d U\n",mc.temperature1At(cursor));
con.print("temperature2: %d U\n",mc.temperature2At(cursor));
// biome, geolayer
con << "biome: " << des.bits.biome << std::endl;
con << "geolayer: " << des.bits.geolayer_index
<< std::endl;
int16_t base_rock = mc.baseMaterialAt(cursor);
if(base_rock != -1)
{
con << "Layer material: " << dec << base_rock;
if(hasmats)
con << " / " << inorganic[base_rock].id
<< " / "
<< inorganic[base_rock].name
<< endl;
else
con << endl;
}
int16_t vein_rock = mc.veinMaterialAt(cursor);
if(vein_rock != -1)
{
con << "Vein material (final): " << dec << vein_rock;
if(hasmats)
con << " / " << inorganic[vein_rock].id
<< " / "
<< inorganic[vein_rock].name
<< endl;
else
con << endl;
}
// liquids
if(des.bits.flow_size)
{
if(des.bits.liquid_type == tile_liquid::Magma)
con <<"magma: ";
else con <<"water: ";
con << des.bits.flow_size << std::endl;
}
if(des.bits.flow_forbid)