Franz Pucher / Bertl

Dependencies:   HCSR

Dependents:   bertl_led bertl_led bertl_led bertl_led ... more

Fork of Bertl by Bertl_Team_PE

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Robot.cpp Source File

Robot.cpp

00001 /***********************************
00002 name:   Robot.cpp    Version: 1.0
00003 author: PE HTL BULME
00004 email:  pe@bulme.at
00005 WIKI:   https://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/
00006 description:
00007         Implementation Robot for objectivRobot
00008         
00009 The following lines have to be added or changed to the *.kpp file:
00010 
00011 #include "Robot.h"
00012 #include "mbed.h"
00013 #include "const.h"
00014 
00015 class Bertl : public Robot  // public
00016 {
00017     public:
00018        Bertl(int x, int y, int d, int b){}; // dumy constrctor with same name as the class name
00019        
00020 rest as in KPP-file:
00021 see in objectBertl/projects/L1_Ex1.KPP
00022 
00023 ***********************************/
00024 #include "mbed.h"
00025 #include "Robot.h"
00026 #include "ur_Bertl.h"
00027 
00028 //Robot::Robot(int x, int y, char[] dir, int beeper) : ur_Robot(){}
00029 
00030 void Robot :: move()   // Definieren
00031 {
00032     Move();
00033 }
00034 
00035 void Robot :: turnLeft()
00036 {
00037     TurnLeft();
00038 }
00039 
00040 void Robot :: pickBeeper()
00041 {
00042     PickBeeper();
00043 }
00044 
00045 void Robot :: putBeeper()
00046 {
00047     PutBeeper();
00048 }
00049 
00050 bool Robot :: frontIsClear()
00051 {
00052     return FrontIsClear();
00053 }
00054 
00055 bool Robot :: nextToABeeper()      //is there one or more beepers in the same corner? 
00056 {
00057     return NextToABeeper();
00058 }
00059 bool Robot :: nextToARobot()        //is there another robot in the corner?
00060 {
00061     return false;
00062 }
00063 bool Robot :: facingNorth()         //is the robot facing North?
00064 {
00065     return true;
00066 }
00067 bool Robot :: facingSouth()      // is the robot facing South?
00068 {
00069     return true;
00070 }
00071 bool Robot :: facingEast()       // is the robot facing East?
00072 {
00073     return true;
00074 }
00075 bool Robot :: facingWest()       // is the robot facing West?
00076 {
00077     return true;
00078 }
00079 bool Robot :: anyBeepersInBeeperBag()    //are there any beepers in the bag?
00080 {
00081     return AnyBeeperInBag();
00082 }