Skip to content

Commit

Permalink
changed #pragma once to #ifndef
Browse files Browse the repository at this point in the history
  • Loading branch information
Feeeeddmmmeee committed May 1, 2022
1 parent 89ae3f3 commit 886b78a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
7 changes: 5 additions & 2 deletions GravitySim/src/Game.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef GAME_H
#define GAME_H

#include "SDL.h"
#include "SDL_image.h"
Expand Down Expand Up @@ -39,4 +40,6 @@ class Game {
Planet* tempPlanet = nullptr;
UIManager* ui;

};
};

#endif
7 changes: 5 additions & 2 deletions GravitySim/src/Planet.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef PLANET_H
#define PLANET_H

#include "Vector.h"
#include <vector>
Expand Down Expand Up @@ -26,4 +27,6 @@ struct Planet
void updatePosition();

void render(SDL_Renderer* renderer, float zoom);
};
};

#endif
7 changes: 5 additions & 2 deletions GravitySim/src/UIElement.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef UI_ELEMENT_H
#define UI_ELEMENT_H

#include <SDL_image.h>
#include <functional>
Expand Down Expand Up @@ -38,4 +39,6 @@ class UIElement
Vector position;
SDL_Texture* texture;
SDL_Rect destRect;
};
};

#endif
7 changes: 5 additions & 2 deletions GravitySim/src/UIManager.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef UI_MANAGER_H
#define UI_MANAGER_H

#include <vector>

Expand All @@ -25,4 +26,6 @@ class UIManager
TTF_Font* font;
SDL_Color color;

};
};

#endif
7 changes: 5 additions & 2 deletions GravitySim/src/Universe.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef UNIVERSE_H
#define UNIVERSE_H

#include "Planet.h"
#include "Vector.h"
Expand All @@ -21,4 +22,6 @@ class Universe

private:
std::vector<Planet*> planets = {};
};
};

#endif
8 changes: 6 additions & 2 deletions GravitySim/src/Vector.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once
#ifndef VECTOR_H
#define VECTOR_H

#include <iostream>

struct Vector
Expand Down Expand Up @@ -31,4 +33,6 @@ struct Vector
double Lenght();

friend std::ostream& operator<<(std::ostream& stream, const Vector vec);
};
};

#endif

0 comments on commit 886b78a

Please sign in to comment.