-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.cpp
55 lines (50 loc) · 1 KB
/
Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
C++ do not have MRO characteristic
*/
#include <stdio.h>
#include <stdlib.h>
class Robot
{
public:
virtual void move_forward()
{
printf("Physical Movement! Moving forward\n");
}
virtual void move_backward()
{
printf("Physical Movement! Moving backward\n");
}
};
class CleaningRobot : public Robot
{
public:
void clean(int times)
{
for(int i=0; i<times; i++)
{
this->move_forward();
this->move_backward();
}
}
};
class MockBot : public Robot
{
public:
void move_forward()
{
printf("forward\n");
}
void move_backward()
{
printf("backward\n");
}
};
class MockCleaningRobot : public CleaningRobot, MockBot
{
};
int main(int argc, char **argv)
{
MockCleaningRobot mockedBot;
mockedBot.clean(10);
return 0;
}