|
- /* Solmyr - H3M manager
- * Copyright (C) 2009 Xavier Gendre
- *
- * This file is part of Solmyr.
- *
- * Solmyr 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.
- *
- * Solmyr 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 Solmyr. If not, see <http://www.gnu.org/licenses/>.
- */
-
- #ifndef H_XG_H3MFILE_1408091444
- #define H_XG_H3MFILE_1408091444
-
- #include "config.hpp"
-
- #include <glibmm/ustring.h>
-
- #ifdef HAVE_LIBZ
- #include <zlib.h>
- #endif // HAVE_LIBZ
-
- namespace Solmyr
- {
-
- class H3mFile
- {
- public:
- H3mFile();
- virtual ~H3mFile();
-
- int open(const char *, const char *);
- void close();
-
- // Accessors
- Glib::ustring get_error() {return m_log;}
- guint32 get_version() {return m_version;}
- guint32 get_size() {return m_size;}
- guint32 get_underground() {return m_underground;}
- Glib::ustring get_name() {return m_name;}
- Glib::ustring get_description() {return m_description;}
- guint8 get_difficulty() {return m_difficulty;}
- guint8 get_max_level() {return m_max_level;}
- guint8 get_player_number() {return m_player_number;}
- guint8 get_human_number() {return m_human_number;}
- guint8 get_victory_condition() {return m_victory_condition;}
- guint8 get_loss_condition() {return m_loss_condition;}
- bool get_allies() {return m_allies;}
-
- protected:
- int get_info();
- int get_header();
- int victory_info_size(guint8);
- int loss_info_size(guint8);
- void set_log(const Glib::ustring str)
- {m_log = m_filename + ": " + str;}
-
- // Informations
- guint32 m_version;
- guint32 m_size;
- bool m_underground;
- Glib::ustring m_name;
- Glib::ustring m_description;
- guint8 m_difficulty;
- guint8 m_max_level;
- guint8 m_player_number;
- guint8 m_human_number;
- guint8 m_victory_condition;
- guint8 m_loss_condition;
- bool m_allies;
-
- private:
- gzFile m_ptrh3m;
- Glib::ustring m_folder;
- Glib::ustring m_filename;
- Glib::ustring m_log;
- };
-
- } // namespace Solmyr
-
- #endif // H_XG_H3MFILE_1408091444
|