MCPcopy Create free account
hub / github.com/crawl/crawl / get_tile

Method get_tile

crawl-ref/source/mapdef.cc:2022–2039  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2020// tile_spec
2021
2022string tile_spec::get_tile()
2023{
2024 if (chose_fixed)
2025 return fixed_tile;
2026
2027 string chosen = "";
2028 int cweight = 0;
2029 for (const map_weighted_tile &tile : tiles)
2030 if (x_chance_in_y(tile.second, cweight += tile.second))
2031 chosen = tile.first;
2032
2033 if (fix)
2034 {
2035 chose_fixed = true;
2036 fixed_tile = chosen;
2037 }
2038 return chosen;
2039}
2040
2041//////////////////////////////////////////////////////////////////////////
2042// map_lines::iterator

Callers 2

overlay_tilesMethod · 0.45
serialize_imageFunction · 0.45

Calls 1

x_chance_in_yFunction · 0.85

Tested by

no test coverage detected