This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-soccer/source/Concept/Framework/main.cpp

73 lines
1.4 KiB
C++
Raw Normal View History

#include "stdafx.h"
2007-01-14 18:07:03 +00:00
int main()
{
//Init our robot
Robot* localRobot = new Robot();
//Init Engines
for(uint8 i = IO_ENGINE_START; i < IO_ENGINE_END; i++)
{
Engine* newEngine = new Engine(i);
localRobot->AddModule(newEngine);
newEngine = NULL;
}
2007-02-15 20:33:05 +00:00
//Init Kicker
for(uint8 i = IO_KICKER_START; i < IO_KICKER_END; i++)
{
Kicker* newKicker = new Kicker(i);
localRobot->AddModule(newKicker);
newKicker = NULL;
}
2007-01-14 18:07:03 +00:00
//Init Sensors
for(uint8 i = IO_SENSOR_START; i < IO_SENSOR_END; i++)
{
switch(i)
{
2007-02-15 20:33:05 +00:00
//Create correct type of sensor
case IO_SENSOR_IR_0_DEG:
case IO_SENSOR_IR_30_DEG:
case IO_SENSOR_IR_60_DEG:
case IO_SENSOR_IR_100_DEG:
case IO_SENSOR_IR_180_DEG:
case IO_SENSOR_IR_260_DEG:
case IO_SENSOR_IR_300_DEG:
case IO_SENSOR_IR_330_DEG:
{
IR_Sensor* newSensor = new IR_Sensor(i);
localRobot->AddModule(newSensor);
newSensor = NULL;
break;
}
2007-01-14 18:07:03 +00:00
//Other cases
default:
2007-02-15 20:33:05 +00:00
{
Sensor* newSensor = new Sensor(i);
localRobot->AddModule(newSensor);
newSensor = NULL;
2007-01-14 18:07:03 +00:00
break;
2007-02-15 20:33:05 +00:00
}
2007-01-14 18:07:03 +00:00
}
2007-02-15 20:33:05 +00:00
}
2007-01-14 18:07:03 +00:00
2007-02-15 20:33:05 +00:00
//Init Leds
for(uint8 i = IO_LED_START; i < IO_LED_END; i++)
{
Led* newLed = new Led(i);
localRobot->AddModule(newLed);
newLed = NULL;
2007-01-14 18:07:03 +00:00
}
//Run
while(true)
{
localRobot->Update();
}
//Cleanup
delete localRobot;
localRobot = NULL;
}