@@ -296,7 +296,7 @@ class Celestial {
296296 shape.setPosition ({static_cast <float >(pos.x ), static_cast <float >(pos.y )});
297297 shape.setFillColor (color);
298298 }
299- Celestial (Physics& physics,Collider collider,int health,double radius,double gravity,int color,bool solid,int index){
299+ Celestial (const Physics& physics,Collider collider,int health,double radius,double gravity,int color,bool solid,int index){
300300 this ->collider = collider;
301301 this ->physics = physics;
302302 this ->health = health;
@@ -353,7 +353,7 @@ class SolarSystem {
353353 std::vector<Celestial> bodies;
354354public:
355355 explicit SolarSystem (const std::vector<Celestial>& bodies) {
356- for (auto & bod : bodies) {
356+ for (const auto & bod : bodies) {
357357 this ->bodies .push_back (bod);
358358 }
359359 };
@@ -437,7 +437,7 @@ class Universe {
437437 systems.push_back (newsystem);
438438 }
439439 }
440- explicit Universe (std::vector<SolarSystem>& systems) {
440+ explicit Universe (const std::vector<SolarSystem>& systems) {
441441 for (const auto & system : systems) {
442442 this ->systems .push_back (system);
443443 }
@@ -448,9 +448,9 @@ class Universe {
448448 ~Universe () {
449449 systems.clear ();
450450 }
451- friend std::ostream& operator <<(std::ostream& out,Universe& universe);
451+ friend std::ostream& operator <<(std::ostream& out,const Universe& universe);
452452};
453- std::ostream& operator <<(std::ostream& out,Universe& universe) {
453+ std::ostream& operator <<(std::ostream& out,const Universe& universe) {
454454 out<<" THE WHOLE UNIVERSE : \n " ;
455455 for (const auto & each_system : universe.systems ) {
456456 out<<each_system<<' \n ' ;
0 commit comments