initial commit, lordsawar source, slightly modified
[lordsawar] / src / network-history.h
diff --git a/src/network-history.h b/src/network-history.h
new file mode 100644 (file)
index 0000000..522fdc0
--- /dev/null
@@ -0,0 +1,55 @@
+// Copyright (C) 2008, 2009 Ben Asselstine
+//
+//  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 Library 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 NETWORK_HISTORY_H
+#define NETWORK_HISTORY_H
+
+#include "history.h"
+#include "OwnerId.h"
+
+//! A history object that's owned by a player, to be sent to another player.
+class NetworkHistory: public OwnerId
+{
+public:
+    //! The xml tag of this object in a network stream.
+    static std::string d_tag; 
+
+     //! Default constructor.
+     NetworkHistory(History *history, guint32 owner);
+
+     //! Loading constructor.
+     NetworkHistory(XML_Helper* helper);
+
+     //! Destructor.
+     ~NetworkHistory();
+
+     //! Returns debug information.
+     std::string toString() const;
+
+     //! copying the deep contents of the history
+     static NetworkHistory* copy(History *history, Player *owner);
+
+     //!Saving the network history to an xml stream.
+     bool save(XML_Helper* helper) const;
+
+     History * getHistory() const {return d_history;};
+     void setHistory (History *history) {d_history = history;};
+
+ private:
+     History *d_history;
+};
+#endif