forked from scummvm/scummvm
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BACKENDS: Add initial code for DLC Manager
- Loading branch information
1 parent
bc3d788
commit e658658
Showing
9 changed files
with
242 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* ScummVM - Graphic Adventure Engine | ||
* | ||
* ScummVM is the legal property of its developers, whose names | ||
* are too numerous to list here. Please refer to the COPYRIGHT | ||
* file distributed with this source distribution. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
|
||
#include "backends/dlc/dlcmanager.h" | ||
#include "backends/dlc/playstore/playstore.h" | ||
|
||
namespace Common { | ||
|
||
DECLARE_SINGLETON(DLC::DLCManager); | ||
|
||
} | ||
|
||
namespace DLC { | ||
|
||
DLCManager::DLCManager() { | ||
// if --playstore flag | ||
_store = new DLC::PlayStore::PlayStore(); | ||
} | ||
|
||
void DLCManager::init() { | ||
|
||
} | ||
|
||
void DLCManager::initDownload() { | ||
_store->requestDownload(); | ||
// handle errors | ||
} | ||
|
||
bool DLCManager::getFeatureState(DLC::Feature f) { | ||
return false; | ||
} | ||
|
||
} // End of namespace DLC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* ScummVM - Graphic Adventure Engine | ||
* | ||
* ScummVM is the legal property of its developers, whose names | ||
* are too numerous to list here. Please refer to the COPYRIGHT | ||
* file distributed with this source distribution. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
#ifndef DLC_DLCMANAGER_H | ||
#define DLC_DLCMANAGER_H | ||
|
||
#include "common/str.h" | ||
#include "common/singleton.h" | ||
#include "backends/dlc/store.h" | ||
|
||
namespace DLC { | ||
|
||
enum Feature { | ||
kInProgress | ||
}; | ||
|
||
class DLCManager : public Common::Singleton<DLCManager> { | ||
|
||
struct DLCDesc { | ||
Common::String name; | ||
Common::String description; | ||
uint32 size; | ||
uint32 game_id; | ||
}; | ||
|
||
Store* _store; | ||
|
||
public: | ||
DLCManager(); | ||
virtual ~DLCManager() {} | ||
|
||
void init(); | ||
|
||
DLCDesc getDLCList(); | ||
|
||
void initDownload(); | ||
|
||
void cancelDownload(); | ||
|
||
bool getFeatureState(DLC::Feature f); | ||
void setFeatureState(DLC::Feature f, bool enable); | ||
|
||
void getPercentDownloaded(); | ||
|
||
uint32 getInProgressGame(); | ||
}; | ||
|
||
#define DLCMan DLC::DLCManager::instance() | ||
|
||
} // End of namespace DLC | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* ScummVM - Graphic Adventure Engine | ||
* | ||
* ScummVM is the legal property of its developers, whose names | ||
* are too numerous to list here. Please refer to the COPYRIGHT | ||
* file distributed with this source distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
|
||
#ifndef BACKENDS_DLC_PLAYSTORE_PLAYSTORE_H | ||
#define BACKENDS_DLC_PLAYSTORE_PLAYSTORE_H | ||
|
||
#include "backends/dlc/store.h" | ||
#include "common/callback.h" | ||
|
||
namespace DLC { | ||
namespace PlayStore { | ||
|
||
class PlayStore: public DLC::Store { | ||
|
||
public: | ||
PlayStore() {} | ||
virtual ~PlayStore() {} | ||
|
||
virtual void init() override {} | ||
|
||
virtual void requestInfo() override {} | ||
|
||
virtual void getDownloadState() override {} | ||
|
||
virtual void requestDownload() override {} | ||
|
||
virtual void getBytesDownloaded() override {} | ||
|
||
virtual void cancelDownload() override {} | ||
}; | ||
|
||
} // End of namespace PlayStore | ||
} // End of namespace DLC | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* ScummVM - Graphic Adventure Engine | ||
* | ||
* ScummVM is the legal property of its developers, whose names | ||
* are too numerous to list here. Please refer to the COPYRIGHT | ||
* file distributed with this source distribution. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
#ifndef DLC_STORE_H | ||
#define DLC_STORE_H | ||
|
||
namespace DLC { | ||
|
||
class Store { | ||
|
||
public: | ||
Store() {} | ||
virtual ~Store() {} | ||
|
||
virtual void init() = 0; | ||
|
||
virtual void requestInfo() = 0; | ||
|
||
virtual void getDownloadState() = 0; | ||
|
||
virtual void requestDownload() = 0; | ||
|
||
virtual void getBytesDownloaded() = 0; | ||
|
||
virtual void cancelDownload() = 0; | ||
}; | ||
|
||
} // End of namespace DLC | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters