32 lines
830 B
C++
32 lines
830 B
C++
#ifndef RICOCHETMATRIX_H
|
|
#define RICOCHETMATRIX_H
|
|
|
|
#include "MatrixAnimation.h"
|
|
#include "RicochetHelper.h"
|
|
|
|
class RicochetMatrix : public MatrixAnimation {
|
|
public:
|
|
RicochetMatrix(LEDHAL2D* _matrix, char* _refName, long _updateTime, uint16_t _numBalls,
|
|
CRGB* _colors, uint8_t _numColors) : MatrixAnimation(_matrix, _refName, _updateTime),
|
|
numBalls(_numBalls), colors(new CRGB[_numColors]), numColors(_numColors),
|
|
balls(new RicochetHelper*[_numBalls]) {
|
|
for(uint8_t i = 0; i < _numColors; i++) {
|
|
colors[i] = _colors[i];
|
|
}
|
|
}
|
|
virtual ~RicochetMatrix() { delete[] colors; delete[] balls; };
|
|
|
|
void initialize();
|
|
void execute();
|
|
private:
|
|
uint16_t
|
|
numBalls;
|
|
CRGB*
|
|
colors;
|
|
uint8_t
|
|
numColors;
|
|
RicochetHelper**
|
|
balls;
|
|
};
|
|
|
|
#endif |