Skip to content

Commit 9d31a98

Browse files
committed
MERGE WTF (i am stupid) LAST SMOKETEST PASAD FOR SURE THIS TIME 11111
1 parent 2ec4b1e commit 9d31a98

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

code/Physics.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Physics {
1212
double mass;
1313
public:
1414
/// CONSTRUCTORS
15-
Physics(): position({0,0}), velocity({0,0}), acceleration({0,0}) {
15+
Physics(): position({0,0}), velocity({0,0}), acceleration({0,0}),mass{0} {
1616
}
1717
explicit Physics(double mass): position({0,0}), velocity({0,0}), acceleration({0,0}) {
1818
this->mass = mass;
@@ -27,6 +27,7 @@ class Physics {
2727
this->position = position;
2828
this->velocity = {0,0};
2929
this->acceleration = {0,0};
30+
this->mass = 0;
3031
}
3132
~Physics() = default;
3233
Physics& operator=(const Physics& state) {

code/SolarSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ std::vector<Celestial*>& SolarSystem::getBodies() {
1919

2020
std::ostream& operator<<(std::ostream& out,const SolarSystem& system) {
2121
out<<"SOLAR SYSTEM\n";
22-
for (const auto& bod : system.bodies) {
22+
for (const auto* bod : system.bodies) {
2323
out<<bod<<'\n';
2424
}
2525
return out;

code/SolarSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ class SolarSystem {
5656
for (const auto* b : bodies) delete b;
5757
}
5858
SolarSystem(const SolarSystem& other): physics(other.physics) {
59-
for (auto* b : other.bodies)
59+
for (const auto* b : other.bodies)
6060
bodies.push_back(b->clone());
6161
}
6262
SolarSystem& operator=(const SolarSystem& other) {
6363
if (this != &other) {
6464
// delete existing bodies
65-
for (auto* b : bodies) delete b;
65+
for (const auto* b : bodies) delete b;
6666
bodies.clear();
6767

6868
physics = other.physics;
69-
for (auto* b : other.bodies)
69+
for (const auto* b : other.bodies)
7070
bodies.push_back(b->clone());
7171
}
7272
return *this;

0 commit comments

Comments
 (0)