Dragonfly 4.20
A text-based game engine
Circle.h
1///
2/// A 2d circle
3///
4
5#ifndef __CIRCLE_H__
6#define __CIRCLE_H__
7
8#include "Vector.h"
9
10namespace df {
11
12class Circle {
13
14 private:
15 Vector m_center; ///< Circle middle.
16 float m_radius; ///< Circle raduis.
17
18 public:
19
20 /// Create circle at center with radius r.
21 Circle(Vector init_center, float init_radius);
22
23 /// Default circle segment is at (0,0) with radius 0.
25
26 void setCenter(Vector new_center); ///< Set center.
27 Vector getCenter() const; ///< Get center.
28 void setRadius(float new_radius); ///< Set radius.
29 float getRadius() const; ///< Get radius.
30 std::string toString() const; ///< Return attributes as string.
31};
32
33} // end of namespace df
34#endif //__CIRCLE_H__
Definition: Circle.h:12
Vector getCenter() const
Get center.
void setCenter(Vector new_center)
Set center.
Circle(Vector init_center, float init_radius)
Create circle at center with radius r.
float m_radius
Circle raduis.
Definition: Circle.h:16
void setRadius(float new_radius)
Set radius.
float getRadius() const
Get radius.
Circle()
Default circle segment is at (0,0) with radius 0.
Vector m_center
Circle middle.
Definition: Circle.h:15
std::string toString() const
Return attributes as string.
Definition: Vector.h:12
An animation for a sprite.
Definition: Animation.h:15