From 163c8f75265054a168cc1e2750a0adb40fb08d83 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 22 Mar 2025 13:01:14 +0000 Subject: Make Collections::objects protected, extend interface Keeps all required features accessible, but through a controlled interface. --- test/test-assetFactory.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/test-assetFactory.cpp') diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp index 72f13b3..68ce6a6 100644 --- a/test/test-assetFactory.cpp +++ b/test/test-assetFactory.cpp @@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE(brush47xml, *boost::unit_test::timeout(5)) BOOST_REQUIRE(brush47rvc->bogies.back()); auto railVehicle = std::make_shared(brush47rvc); - objects.objects.push_back(brush47rvc); + objects.emplace(brush47rvc); render(10000); } @@ -137,7 +137,7 @@ BOOST_AUTO_TEST_CASE(foliage, *boost::unit_test::timeout(5)) auto plant2 = std::make_shared(tree_01_1_f, Location {{3000, -4000, 0}, {0, 1, 0}}); auto plant3 = std::make_shared(tree_01_1_f, Location {{-2000, -4000, 0}, {0, 2, 0}}); auto plant4 = std::make_shared(tree_01_1_f, Location {{3000, 2000, 0}, {0, 3, 0}}); - objects.objects.push_back(tree_01_1_f); + objects.emplace(tree_01_1_f); render(6000); } @@ -160,13 +160,13 @@ BOOST_AUTO_TEST_CASE(lights, *boost::unit_test::timeout(5)) auto light2 = std::make_shared(rlight_f, Location {{-4000, 0, 0}, {0, 2, 0}}); auto light3 = std::make_shared(rlight_f, Location {{-4000, -4000, 0}, {0, 1, 0}}); auto light4 = std::make_shared(oldlamp_f, Location {{3000, 4600, 0}, {0, 2, 0}}); - objects.objects.push_back(rlight_f); - objects.objects.push_back(oldlamp_f); + objects.emplace(rlight_f); + objects.emplace(oldlamp_f); // yes I'm hacking some floor to light up as though its a bush auto floorf = mf->assets.at("floor").dynamicCast(); auto floor = std::make_shared(floorf, Location {}); - objects.objects.push_back(floorf); + objects.emplace(floorf); render(6000); } -- cgit v1.2.3