X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=inline;f=src%2Fport.h;fp=src%2Fport.h;h=fe536a5b2a083dcda45b4cf50c9a88be8658028b;hb=9eda00ff73353c55ecef6f82131166d5d4a85e29;hp=0000000000000000000000000000000000000000;hpb=3d34d4aa85a929f912464f71158396a388274f27;p=lordsawar diff --git a/src/port.h b/src/port.h new file mode 100644 index 0000000..fe536a5 --- /dev/null +++ b/src/port.h @@ -0,0 +1,63 @@ +// Copyright (C) 2007, 2008 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 PORT_H +#define PORT_H + +#include "Location.h" + +//! A port on the game map. +/** + * A port is place on the map that Stack objects can use to gain access to + * the water. + */ +class Port: public Location +{ + public: + //! The xml tag of this object in a saved-game file. + static std::string d_tag; + + //! Default constructor. + /** + * @param pos The location of the port on the game map. + */ + Port(Vector pos); + + //! Copy constructor. + Port(const Port&); + + //! Alternative copying constructor that gives the port a new position. + Port(const Port&, Vector pos); + + //! Loading constructor. + /** + * Load the port object from the opened saved-game file. + * @param helper The opened saved-game file to load the port from. + */ + Port(XML_Helper* helper); + + //! Destructor. + ~Port(); + + // Methods that operate on the class data but do not modify the class. + + //! Save the port data to the opened saved-game file. + bool save(XML_Helper* helper) const; + +}; + +#endif // PORT_H