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
44
45
46
47
48
49
50
/********************************************************************
*
*	Created:	15/4/2014   15:36
*
*	File:		fsITrailComponent.h
*
*	Author:		Mick Waites
*	
*	Purpose:	
*
*********************************************************************/

#ifndef fsITrailComponenthdr
#define fsITrailComponenthdr

#include <fsCore/src/fsCUniqueId.h>

#include "fsIComponent.h"

struct fsPoint;


class fsITrailComponent : public fsIComponent
{
public:

	void initialise(const fsPoint& pStartPos, const fsPoint& pEndPos, fsS32 pBaseDurationMs,
	                fsBool pDestroyParentWhenComplete);

	void updateDo(fsS32 pDeltaMs) override;

	fsBool completedGet() const;

protected:

	fsITrailComponent(fsCEntity* pParent);
	virtual ~fsITrailComponent();<--- Destructor in derived class

	fsS32 mDuration;
	fsS32 mElapsedTime;

private:

	virtual void initialiseDo(const fsPoint& pStartPos, const fsPoint& pEndPos) = 0;
	virtual void updateDo() = 0;

	fsBool mDestroyWhenComplete;
};

#endif