OSDN Git Service

Implement GameWorld::xmlSaveAbility().
authorDeskull <desull@users.sourceforge.jp>
Mon, 9 Jun 2014 22:34:15 +0000 (07:34 +0900)
committerDeskull <desull@users.sourceforge.jp>
Mon, 9 Jun 2014 22:34:15 +0000 (07:34 +0900)
Deeangband/Ability.h
Deeangband/GameWorld.cpp
Deeangband/GameWorld.h

index ca727b6..1db2592 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "stdafx.h"
 #include "Deeangband.h"
+#include "GameElement.h"
 
 namespace Deeangband
 {
@@ -21,7 +22,7 @@ namespace Deeangband
        * <h1>\8aT\97v</h1>
        * <p>Ability\82Í\83N\83\8a\81[\83`\83\83\81[\82ª\83Q\81[\83\80\92\86\82Ì\88ø\82«\8bN\82±\82·\82 \82ç\82ä\82é\94\\93®\93I\8cø\89Ê\82ð\92è\8b`\82·\82é\81B</p>
        */
-       class Ability
+       class Ability : public GameElement
        {
        private:
 
@@ -39,7 +40,6 @@ namespace Deeangband
                        {
                                archive & boost::serialization::make_nvp("Name", name);
                                archive & boost::serialization::make_nvp("Description", description);
-                               archive & boost::serialization::make_nvp("Discipline", disciplinePlus);
                        }
                }
 
index 1720db7..6ab1af8 100644 (file)
@@ -27,6 +27,16 @@ namespace Deeangband
        {
        }
 
+       bool GameWorld::xmlSaveAbility(void)
+       {
+               std::ofstream ofs("lib-Vanilla\\Ability.xml");
+               assert(ofs);
+               boost::archive::xml_oarchive oa(ofs);
+               oa << boost::serialization::make_nvp("Abilities", this->abilityList);
+               ofs.close();
+               return true;
+       }
+
        bool GameWorld::xmlSaveAuthority(void)
        {
                std::ofstream ofs("lib-Vanilla\\Authority.xml");
index e7141ea..e558c5a 100644 (file)
@@ -82,6 +82,14 @@ namespace Deeangband
 
                friend class boost::serialization::access;
 
+
+               /*!
+               * @brief \94­\93®\8bZ\94\\82Ì\83Z\81[\83u
+               * @return \95Û\91\82É\90¬\8c÷\82·\82ê\82ÎTRUE\82ð\95Ô\82·
+               * @todo \95Û\91\8f\88\97\9d\82Ì\83G\83\89\81[\94»\92è
+               */
+               bool GameWorld::xmlSaveAbility(void);
+
                /*!
                * @brief \8c \94\\8fî\95ñ\82Ì\83Z\81[\83u
                * @return \95Û\91\82É\90¬\8c÷\82·\82ê\82ÎTRUE\82ð\95Ô\82·