gameexeretriever.cpp
1 //------------------------------------------------------------------------------
2 // gameexeretriever.cpp
3 //------------------------------------------------------------------------------
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301, USA.
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2013 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #include "gameexeretriever.h"
24 
25 #include "serverapi/exefile.h"
26 #include "serverapi/gameexefactory.h"
27 
28 GameExeRetriever::GameExeRetriever(GameExeFactory& factory)
29 : factory(factory)
30 {
31 }
32 
33 QString GameExeRetriever::pathToOfflineExe(Message& message)
34 {
35  ExeFile* f = factory.offline();
36  QString path = f->pathToExe(message);
37  delete f;
38  return path;
39 }
40 
41 QString GameExeRetriever::pathToServerExe(Message& message)
42 {
43  ExeFile* f = factory.server();
44  QString path = f->pathToExe(message);
45  delete f;
46  return path;
47 }
48 
49 QString GameExeRetriever::offlineWorkingDir(Message& message)
50 {
51  ExeFile* f = factory.offline();
52  QString path = f->workingDirectory(message);
53  delete f;
54  return path;
55 }
56 
57 QString GameExeRetriever::serverWorkingDir(Message& message)
58 {
59  ExeFile* f = factory.server();
60  QString path = f->workingDirectory(message);
61  delete f;
62  return path;
63 }
Message object used to pass messages throughout the Doomseeker's system.
Definition: message.h:62
Returns executable file retrievers from plugins to Doomseeker.
virtual QString pathToExe(Message &message)
Returns the path to the executable file.
Definition: exefile.cpp:67
ExeFile * server()
[Virtual] Instantiates retriever for server executable.
virtual QString workingDirectory(Message &message)
Path to this executable working directory.
Definition: exefile.cpp:118
ExeFile * offline()
[Virtual] Instantiates retriever for offline game executable.
Access to external program executables (game clients, servers, and so on).
Definition: exefile.h:48