MCPcopy Create free account
hub / github.com/DFHack/dfhack / biomeIndexAt

Method biomeIndexAt

library/modules/MapCache.cpp:1107–1120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1105}
1106
1107int MapExtras::Block::biomeIndexAt(df::coord2d p)
1108{
1109 if (!block)
1110 return -1;
1111
1112 auto des = index_tile(designation,p);
1113 uint8_t idx = des.bits.biome;
1114 if (idx >= 9)
1115 return -1;
1116 idx = block->region_offset[idx];
1117 if (idx >= parent->biomes.size())
1118 return -1;
1119 return idx;
1120}
1121
1122const BiomeInfo &Block::biomeInfoAt(df::coord2d p)
1123{

Callers 1

mapLayerMethod · 0.80

Calls 2

index_tileFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected