1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#ifndef _CRANDOMVELEVENT_
#define _CRANDOMVELEVENT_
#include "CParticle.h"
#include "CTimedEvent.h"
class CRandomVelEvent : public CTimedEvent
{
public:
CRandomVelEvent(CParticle &p, double prob, int period, double changeX, double changeY, bool c)
: CTimedEvent(period, c), p(p), prob(prob), changeX(changeX), changeY(changeY) { }
void doUpdate();
CRandomVelEvent* getCopy() { return new CRandomVelEvent(*this); }
private:
double prob;
double changeX, changeY;
CParticle &p;
};
#endif
|