Fission FSN
Loading...
Searching...
No Matches
fsCEphemeralComponent.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsCEphemeralComponent.h
4*
5* Purpose: Keep an entity alive until....
6*
7*********************************************************************/
8
9#ifndef fsCEphemeralComponenthdr
10#define fsCEphemeralComponenthdr
11
12//#include <functional>
13
14#include "fsIComponent.h"
15
17{
18 friend fsCComponentFactory;
19
20public:
21
23 {
24 public:
25 virtual fsBool operator()(fsCEntity* pParent) = 0;
26
28 {
29 }
30 };
31
32 static const fsCUniqueId mTypeId;
33
34 // void init(std::function< fsBool (fsCEntity* const pParent) > pCondition);
35 void init(fsFncCondition* pCondition);
36
37protected:
38
39 void updateDo(fsS32 pDeltaMs) override;
40
41 static fsIComponent* create(fsCEntity* pParent);
44
45private:
46
47 // std::function< fsBool (fsCEntity* const pParent) > mCondition;
48 fsFncCondition* mCondition;
49};
50
51
52#endif
Definition fsCEntity.h:39
Definition fsCEphemeralComponent.h:23
virtual ~fsFncCondition()
Definition fsCEphemeralComponent.h:27
virtual fsBool operator()(fsCEntity *pParent)=0
fsCEphemeralComponent(fsCEntity *pParent)
Definition fsCEphemeralComponent.cpp:27
void updateDo(fsS32 pDeltaMs) override
Definition fsCEphemeralComponent.cpp:8
static fsIComponent * create(fsCEntity *pParent)
Definition fsCEphemeralComponent.cpp:22
~fsCEphemeralComponent()
Definition fsCEphemeralComponent.cpp:33
static const fsCUniqueId mTypeId
Definition fsCEphemeralComponent.h:32
void init(fsFncCondition *pCondition)
Definition fsCEphemeralComponent.cpp:17
Definition fsCUniqueId.h:21
fsIComponent(fsCEntity *pParent)
Definition fsIComponent.cpp:86
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20