begin implementing polymorphism
This commit is contained in:
20
src/object.hpp
Normal file
20
src/object.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef __OBJECT_H_
|
||||
#define __OBJECT_H_
|
||||
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
class Object {
|
||||
protected:
|
||||
double x, y;
|
||||
const unsigned short radius;
|
||||
|
||||
sf::CircleShape appearance;
|
||||
|
||||
protected:
|
||||
Object(double x, double y, unsigned short radius);
|
||||
|
||||
public:
|
||||
virtual bool collide(const Object& other);
|
||||
};
|
||||
|
||||
#endif // __OBJECT_H_
|
11
src/umwelt.hpp
Normal file
11
src/umwelt.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef __UMWELT_H_
|
||||
#define __UMWELT_H_
|
||||
|
||||
#include <vector>
|
||||
#include "object.hpp"
|
||||
|
||||
struct Umwelt {
|
||||
std::vector<Object> objects;
|
||||
};
|
||||
|
||||
#endif // __UMWELT_H_
|
Reference in New Issue
Block a user