2018-04-08 16:20:11 +00:00
|
|
|
#ifndef WAGON_H
|
|
|
|
#define WAGON_H
|
|
|
|
#include <Adafruit_NeoPixel.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
class Wagon
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int _id;
|
2018-04-10 19:17:45 +00:00
|
|
|
Wagon(int id,int numpixels,Adafruit_NeoPixel *strip,uint8_t *height, float pos, float wagonlength, float startvel,float startacc, float wagonmass, uint32_t wagoncolor);
|
2018-04-08 16:20:11 +00:00
|
|
|
Wagon();
|
|
|
|
bool operator==(const Wagon &r) const;
|
|
|
|
void updatePhysics(float updatedelayms);
|
|
|
|
void updateGraphics();
|
|
|
|
float getHeight(int p);
|
2018-04-08 17:47:34 +00:00
|
|
|
uint32_t Wheel(byte WheelPos,float brightness);
|
2018-04-08 16:20:11 +00:00
|
|
|
int pos();
|
|
|
|
int id();
|
2018-04-08 17:47:34 +00:00
|
|
|
long spawntime();
|
2018-04-08 16:20:11 +00:00
|
|
|
bool alive();
|
|
|
|
private:
|
|
|
|
int _numpixels;
|
|
|
|
Adafruit_NeoPixel *_strip;
|
|
|
|
float _pos;
|
|
|
|
float _vel;
|
|
|
|
float _acc;
|
2018-04-10 19:17:45 +00:00
|
|
|
float _wagonmass;
|
2018-05-06 16:14:11 +00:00
|
|
|
float _trainlength;
|
2018-04-08 16:20:11 +00:00
|
|
|
uint8_t *_height;
|
2018-04-08 17:47:34 +00:00
|
|
|
long _spawntime;
|
2018-04-10 19:17:45 +00:00
|
|
|
long _lasttimefast;
|
|
|
|
uint32_t _wagoncolor;
|
2018-04-08 16:20:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|