Classempathy::brain::Brain
brain
Bases
Subclasses
Constructors
Member Functions

Classempathy::brain::Brain

Consider them the computer which take time as input and give the output on the screen.

Here's the deal: You want to build an amazing LifeEvent and also need dynamic control? Well,you might need to extend this class, or send JSON to JSONBrain file.

Bases

radio::Subscriber

The class to be overridden to emit/receive events.

Subclasses

DummyTouchBrain
MusicalBrain
JSONBrain

Create a Brain by parsing a JSON file using JSONBrain.

DummyBrain

Constructors

Brain ( )

Constructor

Member Functions

  • virtual
void
addTo ( Empathy * binder )

Sometimes a brain needs to dynamically do stuffs before adding itself to the app. That's where addTo(Empathy) comes handy in.

binder
GLfloat
getDelay ( )

How late the begin action should be called.

return
  • override
void
onReceiveEvent ( radio::Event & event )

Called when an event is received for this subscriber.

event
void
run ( )

Start running lines on this empathy::brain::Brain::Brain usually called by the empathy::You class

void
setDelay ( GLfloat delay )

How late the begin action should be called.

delay
  • virtual
void
terminate ( )

A basic override function created for handling brain termination due to program abort.

Remember to call superclass while overriding.

  • protected
void
activateTimeoutForNextLine ( std::__cxx11::string lineID,
GLfloat afterTime )

Activate timeout for a certain line.

lineID
afterTime
  • protected
void
activateTimeoutForNextLine ( std::__cxx11::string lineID,
GLfloat afterTime,
std::__cxx11::string callerLineID )

Activate timeout for a certain line.

lineID
afterTime
callerLineID
  • protected
void
addLifeEvent ( life_event::LifeEvent * event )

Add life event to the current gamescreen.

event
  • protected
  • virtual
  • abstract
void
runLineNumber ( std::__cxx11::string lineID,
std::__cxx11::string callerID )

Any extension of Brain class must override this function. What it does is receive instructions. For example, when the program begins, lineID is "begin" and when you need to play a music, it will be something like "playBeethoven". Your choice.

lineID
callerID