1 // Copyright (C) 2008, 2014, 2017 Ben Asselstine
2 //
3 //  This program is free software; you can redistribute it and/or modify
4 //  it under the terms of the GNU General Public License as published by
5 //  the Free Software Foundation; either version 3 of the License, or
6 //  (at your option) any later version.
7 //
8 //  This program is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 //  GNU Library General Public License for more details.
12 //
13 //  You should have received a copy of the GNU General Public License
14 //  along with this program; if not, write to the Free Software
15 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 //  02110-1301, USA.
17 
18 #pragma once
19 #ifndef NETWORK_ACTION_H
20 #define NETWORK_ACTION_H
21 
22 #include "action.h"
23 #include "OwnerId.h"
24 
25 //! Just like Action, but explicitly associated with a Player.
26 class NetworkAction: public OwnerId
27 {
28 public:
29 
30     //! The xml tag of this object in a network stream.
31     static Glib::ustring d_tag;
32 
33      //! Default constructor.
34      NetworkAction(const Action *action, guint32 owner);
35 
36      //! Loading constructor.
37      NetworkAction(XML_Helper* helper);
38 
39      //! Destructor.
40      ~NetworkAction();
41 
42      //! Returns debug information.
43      Glib::ustring toString() const;
44 
45      //!Saving the network action to an xml stream.
46      bool save(XML_Helper* helper) const;
47 
getAction()48      Action * getAction() const {return d_action;};
49 
setAction(Action * action)50      void setAction (Action *action) {d_action = action;};
51  private:
52      Action *d_action;
53 };
54 #endif
55