player_config.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Robot.hpp"
4 #include <cstdlib>
5 #include <iostream>
6 
7 //Welcome to Hackville.
8 
9 #define RBP_NUM_PLAYERS 2
10 
11 //#include "YourRobotName.hpp"
12 #include "DemoBot.hpp"
13 #include "DefenderBot.hpp"
14 //...
15 
16 typedef DemoBot Player1;
18 //typedef DefenderBot Player2;
19 //typedef DemoBot Player3;
20 //typedef ManualBot Player4;
21 
22 #define RBP_CALL_CONSTRUCTOR(x) rbp_construct_robot(x)
23 
25 {
26  switch(x)
27  {
28 #if 1 <= RBP_NUM_PLAYERS
29  case 1: return new Player1();
30  break;
31 #endif
32 #if 2 <= RBP_NUM_PLAYERS
33  case 2: return new Player2();
34  break;
35 #endif
36 #if 3 <= RBP_NUM_PLAYERS
37  case 3: return new Player3();
38  break;
39 #endif
40 #if 4 <= RBP_NUM_PLAYERS
41  case 4: return new Player4();
42  break;
43 #endif
44 #if 5 <= RBP_NUM_PLAYERS
45  case 5: return new Player5();
46  break;
47 #endif
48 #if 6 <= RBP_NUM_PLAYERS
49  case 6: return new Player6();
50  break;
51 #endif
52 #if 7 <= RBP_NUM_PLAYERS
53  case 7: return new Player7();
54  break;
55 #endif
56 #if 8 <= RBP_NUM_PLAYERS
57  case 8: return new Player8();
58  break;
59 #endif
60 #if 9 <= RBP_NUM_PLAYERS
61  case 9: return new Player9();
62  break;
63 #endif
64 #if 10 <= RBP_NUM_PLAYERS
65  case 10: return new Player10();
66  break;
67 #endif
68 #if 11 <= RBP_NUM_PLAYERS
69  case 11: return new Player11();
70  break;
71 #endif
72 #if 12 <= RBP_NUM_PLAYERS
73  case 12: return new Player12();
74  break;
75 #endif
76 #if 13 <= RBP_NUM_PLAYERS
77  case 13: return new Player13();
78  break;
79 #endif
80 #if 14 <= RBP_NUM_PLAYERS
81  case 14: return new Player14();
82  break;
83 #endif
84 #if 15 <= RBP_NUM_PLAYERS
85  case 15: return new Player15();
86  break;
87 #endif
88 #if 16 <= RBP_NUM_PLAYERS
89  case 16: return new Player16();
90  break;
91 #endif
92 #if 17 <= RBP_NUM_PLAYERS
93  case 17: return new Player17();
94  break;
95 #endif
96 #if 18 <= RBP_NUM_PLAYERS
97  case 18: return new Player18();
98  break;
99 #endif
100 #if 19 <= RBP_NUM_PLAYERS
101  case 19: return new Player19();
102  break;
103 #endif
104 #if 20 <= RBP_NUM_PLAYERS
105  case 20: return new Player20();
106  break;
107 #endif
108  default: std::cerr << "rbp_construct_robot was called with an invalid value.\n";
109  std::cerr << "This is a fatal condition.\n";
110  std::abort();
111  break;
112  }
113 
114  return NULL;
115 }
Definition: Robot.hpp:19
Robot * rbp_construct_robot(int x)
int x
Definition: test.cpp:1
DefenderBot Player2
DemoBot Player1