MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / start

Function start

Source/Start.cpp:29–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#ifndef _OFBOT
28
29int start(int argc, char *argv[]) {
30 g_Debugger = std::make_shared<cDebugger>();
31 g_Window = std::make_shared<cWindow>();
32 g_ResourceMan = std::make_shared<cResourceMan>();
33 g_Fodder = std::make_shared<cFodder>(g_Window);
34
35 auto Params = std::make_shared<sFodderParameters>();
36 Params->Process(argc, argv);
37
38 if (Params->mShowHelp)
39 return 0;
40
41 g_Fodder->Prepare(Params);
42 std::thread myThread(&cFodder::Interrupt_Sim, g_Fodder);
43 int result = 0;
44
45 if (g_Fodder->mStartParams->mUnitTesting) {
46 cUnitTesting Testing;
47 result = Testing.Start() ? 0 : -1;
48 }
49 else if (g_Fodder->mStartParams->mRandomSave) {
50 sMapParams Params(g_Fodder->mRandom.get());
51 g_Fodder->CreateRandom(Params);
52 }
53 else {
54 g_Fodder->Start();
55 g_Fodder->mGame_Data.mDemoRecorded.save();
56 }
57
58 {
59 g_Fodder->mExit = true;
60 myThread.join();
61 }
62 return result;
63}
64
65// Debug stuff
66void quickServiceScreen() {

Callers 1

mainFunction · 0.70

Calls 6

ProcessMethod · 0.80
PrepareMethod · 0.80
CreateRandomMethod · 0.80
StartMethod · 0.45
getMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected