The stadium and its surroundings as two fixed views; the surroundings in detail
The camera no longer flies: the stadium view shows stands and facilities, the surroundings view the fourteen objects of the periphery, each in a shape of its own (road, bus stop, tram and station by level; parking lots with bays and cars; shopping centre, arcade, club house, restaurant, snack bars, fan shops in the club's colour). A part is chosen in the picture or from a list and shown on a card that leads to the builder's offer. The painted panorama is no longer used. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
20e7497f67
commit
6e3475493f
5 files changed
+274
-98
No files matched your search
@@ -549,21 +549,29 @@ int main(int argc, char **argv) try {
|
||||
for (int i = 0; i < 8; ++i) overview["facilities"].push_back({{"name", "Anlage"}, {"display_level", 2}, {"building", false}});
|
||||
for (int i = 0; i < 14; ++i) overview["periphery"].push_back({{"name", "Haus"}, {"level", i % 3}, {"max_level", 3}, {"building", false}});
|
||||
const auto scene = stadium3d::build(overview, "#aa2233", true);
|
||||
require(scene.centres.contains("block:7") && scene.centres.contains("facility:0") && scene.centres.contains("periphery:13"),
|
||||
"Stadium model misses a selectable part");
|
||||
const auto whole = stadium3d::draw(scene, stadium3d::camera_for(scene, ""), 1790, 1600);
|
||||
const auto again = stadium3d::draw(stadium3d::build(overview, "#aa2233", true), stadium3d::camera_for(scene, ""), 1790, 1600);
|
||||
require(whole.svg == again.svg && whole.svg.size() > 4000,
|
||||
"Stadium model is not drawn the same way twice");
|
||||
require(scene.centres.contains("block:7") && scene.centres.contains("facility:0") && !scene.centres.contains("periphery:0"),
|
||||
"The stadium's view should offer stands and facilities only");
|
||||
const auto inside = stadium3d::fixed_camera(false);
|
||||
const auto whole = stadium3d::draw(scene, inside, 1790, 1600);
|
||||
const auto again = stadium3d::draw(stadium3d::build(overview, "#aa2233", true), inside, 1790, 1600);
|
||||
require(whole.svg == again.svg && whole.svg.size() > 4000, "Stadium model is not drawn the same way twice");
|
||||
require(std::count_if(whole.anchors.begin(), whole.anchors.end(), [](const auto &a) { return a.id == "facility:0"; }) == 4,
|
||||
"Each floodlight mast should choose the floodlights");
|
||||
const auto near = stadium3d::camera_for(scene, "block:5"), far = stadium3d::camera_for(scene, "stadium");
|
||||
require(near.zoom > far.zoom && stadium3d::mix(far, near, 0).zoom == far.zoom && stadium3d::mix(far, near, 1).zoom == near.zoom,
|
||||
"Camera flight does not start and end at its stations");
|
||||
const auto close = stadium3d::draw(scene, near, 1790, 1600, "block:5");
|
||||
const auto chosen = std::find_if(close.parts.begin(), close.parts.end(), [](const auto &p) { return p.id == "block:5"; });
|
||||
require(chosen != close.parts.end() && chosen->cx > 300 && chosen->cx < 1490 && chosen->cy > 300 && chosen->cy < 1300,
|
||||
"The chosen stand does not lie in the middle of the picture");
|
||||
for (const auto &part : whole.parts)
|
||||
if (part.id.starts_with("block:"))
|
||||
require(part.cx > 100 && part.cx < 1690 && part.cy > 100 && part.cy < 1500, "A stand lies outside the fixed camera's picture");
|
||||
// the surroundings: every object is a part of its own, and every level draws more
|
||||
const auto around = stadium3d::build(overview, "#aa2233", true, 1);
|
||||
require(around.centres.size() == 14 && around.centres.contains("periphery:13") && !around.centres.contains("block:0"),
|
||||
"The surroundings should offer their fourteen objects only");
|
||||
auto grown = overview;
|
||||
grown["periphery"][0]["level"] = 4;
|
||||
grown["periphery"][4]["level"] = 3;
|
||||
require(stadium3d::build(grown, "#aa2233", true, 1).faces.size() > around.faces.size() + 20,
|
||||
"Higher levels of road and parking should show more");
|
||||
const auto outside = stadium3d::draw(around, stadium3d::fixed_camera(true), 1790, 1600);
|
||||
for (const auto &anchor : outside.anchors)
|
||||
require(anchor.x > 40 && anchor.x < 1750 && anchor.y > 40 && anchor.y < 1560, "An object of the surroundings lies outside the picture");
|
||||
}
|
||||
auto corrupt = layout;
|
||||
corrupt["objects"]["calendar"]["x"] = 999999;
|
||||
|
||||
Reference in new issue
Block a user