MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / previewAddBiomeRegion

Method previewAddBiomeRegion

source/game/StarWorldTemplate.cpp:203–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203List<RectI> WorldTemplate::previewAddBiomeRegion(Vec2I const& position, int width) {
204 if (auto terrestrialParameters = as<TerrestrialWorldParameters>(m_worldParameters)) {
205 auto regionRects = m_layout->previewAddBiomeRegion(position, width);
206 regionRects.transform([terrestrialParameters](RectI const& rect) {
207 return rect.padded(ceil(terrestrialParameters->blendSize));
208 });
209 return regionRects;
210 } else {
211 Logger::error("Cannot add biome region to non-terrestrial world!");
212 // throw StarException("Cannot add biome region to non-terrestrial world!");
213 return List<RectI>();
214 }
215}
216
217List<RectI> WorldTemplate::previewExpandBiomeRegion(Vec2I const& position, int newWidth) {
218 if (auto terrestrialParameters = as<TerrestrialWorldParameters>(m_worldParameters)) {

Callers

nothing calls this directly

Calls 3

errorFunction · 0.85
paddedMethod · 0.80
transformMethod · 0.45

Tested by

no test coverage detected