44 lines
955 B
C++
44 lines
955 B
C++
#include "robot.h"
|
|
|
|
//-----------------------------------------------------------------------------
|
|
Robot::Robot()
|
|
{
|
|
memset(modules, NULL, sizeof(modules));
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
Robot::~Robot()
|
|
{
|
|
for(uint8 i = 0; i < IO_END; i++)
|
|
{
|
|
if(!modules[i]) continue;
|
|
|
|
delete modules[i];
|
|
modules[i] = NULL;
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
bool Robot::AddModule(IO_Module* newModule)
|
|
{
|
|
if(modules[newModule->GetId()])
|
|
return false;
|
|
|
|
modules[newModule->GetId()] = newModule;
|
|
|
|
return true;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
bool Robot::RemoveModule(IO_Module* oldModule)
|
|
{
|
|
return RemoveModule(oldModule->GetId());
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
void Robot::Update()
|
|
{
|
|
//insert code here
|
|
}
|
|
|
|
//--- EOF ---
|