-
Notifications
You must be signed in to change notification settings - Fork 1
/
magnet.h
43 lines (30 loc) · 821 Bytes
/
magnet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __MAGNET_H__
#define __MAGNET_H__
#include "mathfunctions.h"
#include "ball.h"
class Magnet
:public Entity
{
private:
Polarity charge;
double magneticForce;
double maxDistance;
Window* window;
bool on;
bool linearForce;
double brightness;
public:
Magnet(string name, Polarity c, double strength, double reach, bool on, bool linear, Point center,double radius);
void onAlways();
void setPolarity(Polarity c);
void setStrength(double s);
void setReach(double distance);
void pull(Entity* b);
void push(Entity* b);
Polarity getCharge() const;
double getStrength() const;
double getReach() const;
void draw();
void onTouch();
};
#endif