athena/include/Athena/ZQuestFile.hpp

168 lines
3.9 KiB
C++
Raw Normal View History

#ifndef ATHENA_NO_ZQUEST
2014-04-20 09:14:15 +00:00
// This file is part of libAthena.
//
2014-04-20 09:14:15 +00:00
// libAthena 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.
//
2014-04-20 09:14:15 +00:00
// libAthena 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
2014-04-20 09:14:15 +00:00
// along with libAthena. If not, see <http://www.gnu.org/licenses/>
2013-07-21 03:51:26 +00:00
#ifndef ZQUEST_HPP
#define ZQUEST_HPP
2014-04-20 09:14:15 +00:00
#include "Athena/Global.hpp"
2013-07-21 03:51:26 +00:00
#include <string>
#include <vector>
#include <memory>
2013-07-21 03:51:26 +00:00
#define ZQUEST_VERSION_CHECK(major, minor, revision) \
(major | (minor << 8) | (revision << 16))
2014-04-20 09:14:15 +00:00
namespace Athena
2013-07-21 03:51:26 +00:00
{
/*!
* \brief ZQuestFile is an export format for save data.
*/
class ZQuestFile
2013-07-21 03:51:26 +00:00
{
public:
/*!
* \brief The current major version of the ZQuest format
*/
static const atUint32 Major;
/*!
* \brief The current minor version of the ZQuest format
*/
static const atUint32 Minor;
/*!
* \brief The current revision of the ZQuest format
*/
static const atUint32 Revision;
/*!
* \brief The current version of the ZQuest format
*/
static const atUint32 Version;
2013-07-21 03:51:26 +00:00
/*!
* \brief The magic number used to identify the file e.g. "ZQS1"
*/
static const atUint32 Magic;
2013-07-21 03:51:26 +00:00
/*!
* \enum Game
* \brief The list of games currently supported by ZQuest
*/
2013-07-21 03:51:26 +00:00
enum Game
{
NoGame, //!< None or Unsupported
LoZ, //!< Legend of Zelda
AoL, //!< Adventure of Link
ALttP, //!< A Link to the Past
LA, //!< Links Awakening
OoT, //!< Ocarin of Time
OoT3D, //!< Ocarina of Time 3D
MM, //!< Majora's Mask
OoS, //!< Oracle of Season
OoA, //!< Oracle of Ages
FS, //!< Four Swords
WW, //!< Wind Waker
FSA, //!< Four Swords Adventures
MC, //!< Minish Cap
TP, //!< Twilight Princess
PH, //!< Phantom Hourglass
ST, //!< Spirit Tracks
SS, //!< Skyward Sword
ALBW, //!< A Link Between Worlds
// Add more games here
// This must always be last
GameCount //!< Total number of supported games
2013-07-21 03:51:26 +00:00
};
/*!
* \brief ZQuest
*/
ZQuestFile();
/*!
* \brief ZQuest
* \param game
* \param endian
* \param data
* \param length
*/
ZQuestFile(Game game, Endian endian, std::unique_ptr<atUint8[]>&& data, atUint32 length, const std::string& gameString = std::string());
2013-07-21 03:51:26 +00:00
/*!
* \brief setGame
* \param game
*/
2013-07-21 03:51:26 +00:00
void setGame(Game game);
/*!
* \brief game
* \return
*/
2013-07-21 03:51:26 +00:00
Game game() const;
/*!
* \brief setEndian
* \param endian
*/
2013-07-21 03:51:26 +00:00
void setEndian(Endian endian);
/*!
* \brief endian
* \return
*/
2013-07-21 03:51:26 +00:00
Endian endian() const;
/*!
* \brief setData
* \param data The data to assign
* \param length The length of the data
*/
void setData(std::unique_ptr<atUint8[]>&& data, atUint32 length);
/*!
* \brief data
* \return
*/
atUint8* data() const;
2013-07-21 03:51:26 +00:00
/*!
* \brief length
* \return
*/
atUint32 length() const;
2013-07-21 03:51:26 +00:00
void setGameString(const std::string& gameString);
/*!
* \brief gameString
* \return
*/
2013-07-21 03:51:26 +00:00
std::string gameString() const;
static const std::vector<std::string> gameStringList();
protected:
Game m_game;
std::string m_gameString;
Endian m_endian;
std::unique_ptr<atUint8[]> m_data;
atUint32 m_length;
2013-07-21 03:51:26 +00:00
// Game strings support
};
} // zelda
#endif // ZQUEST_HPP
#endif // ATHENA_NO_ZQUEST