MCPcopy Create free account
hub / github.com/LARG/HFO / initImpl

Method initImpl

src/sample_player.cpp:167–216  ·  view source on GitHub ↗

-------------------------------------------------------------------*/ ! */

Source from the content-addressed store, hash-verified

165
166 */
167bool
168SamplePlayer::initImpl( CmdLineParser & cmd_parser )
169{
170 bool result = PlayerAgent::initImpl( cmd_parser );
171
172 // read additional options
173 result &= Strategy::instance().init( cmd_parser );
174
175 rcsc::ParamMap my_params( "Additional options" );
176#if 0
177 std::string param_file_path = "params";
178 param_map.add()
179 ( "param-file", "", &param_file_path, "specified parameter file" );
180#endif
181
182 cmd_parser.parse( my_params );
183
184 if ( cmd_parser.count( "help" ) > 0 )
185 {
186 my_params.printHelp( std::cout );
187 return false;
188 }
189
190 if ( cmd_parser.failed() )
191 {
192 std::cerr << "player: ***WARNING*** detected unsuppprted options: ";
193 cmd_parser.print( std::cerr );
194 std::cerr << std::endl;
195 }
196
197 if ( ! result )
198 {
199 return false;
200 }
201
202 if ( ! Strategy::instance().read( config().configDir() ) )
203 {
204 std::cerr << "***ERROR*** Failed to read team strategy." << std::endl;
205 return false;
206 }
207
208 if ( KickTable::instance().read( config().configDir() + "/kick-table" ) )
209 {
210 std::cerr << "Loaded the kick table: ["
211 << config().configDir() << "/kick-table]"
212 << std::endl;
213 }
214
215 return true;
216}
217
218/*-------------------------------------------------------------------*/
219/*!

Callers

nothing calls this directly

Calls 2

readMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected