LogicConnector Class Reference
[Logic minigame]

#include <logicconnector.h>

Inherits Layer, and ClickListener.

Collaboration diagram for LogicConnector:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LogicConnector (LogicMinigame *game, LogicComponent *input)
 ~LogicConnector ()
void repath ()
 Redo the pathing of this connector.
void clearRobots ()
 Delete all the robots from this connector.
void addOutput (LogicComponent *newoutput)
 Set the output component.
void removeOutput ()
 Remove the output component.
void addRobot (bool truth)
void tick ()
 Moves the robots on this connection.
void onClick (MouseEvent *e)
 From interface ClickListener. Linked to connectionBox.

Protected Member Functions

void extendPath ()
 Animates the extension of the tube.

Static Protected Member Functions

static bool pathEnd (LogicRobotPosition *robotPos)
 Is the robot at the end of the path?

Protected Attributes

LogicMinigamegame
 The minigame that created this connector.
LogicComponentinput
 The component that feeds this connector.
LogicComponentoutput
 The component this connector leads to.
int outputSlot
 The slot of the output component that this connector is connected to.
std::list< LogicRobotPosition * > robots
 The robots currently traveling along this connector.
std::list< LogicConnectionPath * > paths
 The straight-line paths this connector takes.
LayerrobotLayer
 The layer the robot graphics are in.
LayerunderLayer
 The layer the far half of the tube is in.
DraggableconnectionBox
 A draggable object to connect this object to a component.
bool completed
 Controls whether the series of tubes has finished its animation.


Detailed Description

This class represents the tubes connecting LogicComponents. Each tube belongs to the component in front of it, so there is a one-to-one correspondence between tubes and generators/gates.

Constructor & Destructor Documentation

LogicConnector::LogicConnector ( LogicMinigame game,
LogicComponent input 
)

LogicConnector::~LogicConnector (  ) 


Member Function Documentation

void LogicConnector::addOutput ( LogicComponent newoutput  ) 

Set the output component.

If newoutput has no open input slots, this does nothing. Otherwise, removes the current output (if any) and attempts to path to the new output. If pathing fails, the component will end up with no output at all.

void LogicConnector::addRobot ( bool  truth  ) 

void LogicConnector::clearRobots (  ) 

Delete all the robots from this connector.

void LogicConnector::extendPath (  )  [protected]

Animates the extension of the tube.

void LogicConnector::onClick ( MouseEvent e  )  [virtual]

From interface ClickListener. Linked to connectionBox.

Implements ClickListener.

bool LogicConnector::pathEnd ( LogicRobotPosition robotPos  )  [static, protected]

Is the robot at the end of the path?

void LogicConnector::removeOutput (  ) 

Remove the output component.

void LogicConnector::repath (  ) 

Redo the pathing of this connector.

void LogicConnector::tick (  ) 

Moves the robots on this connection.


Member Data Documentation

bool LogicConnector::completed [protected]

Controls whether the series of tubes has finished its animation.

A draggable object to connect this object to a component.

The minigame that created this connector.

The component that feeds this connector.

The component this connector leads to.

int LogicConnector::outputSlot [protected]

The slot of the output component that this connector is connected to.

std::list<LogicConnectionPath*> LogicConnector::paths [protected]

The straight-line paths this connector takes.

The layer the robot graphics are in.

std::list<LogicRobotPosition*> LogicConnector::robots [protected]

The robots currently traveling along this connector.

The layer the far half of the tube is in.


The documentation for this class was generated from the following files:

Generated on Mon Mar 16 14:33:10 2009 for LearningGaming by  doxygen 1.5.7.1