X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fportable.hpp;h=721879d6ae3191b238dcb1d9a5f50de1e95c07c4;hb=4a486d92343d1824b311c234e9321e08f280fe68;hp=ae7199b642597ff44602ae59a9b3a80765d19581;hpb=fbf5cd9ecbfa34368697837587873d82a098494f;p=supertux.git diff --git a/src/object/portable.hpp b/src/object/portable.hpp index ae7199b64..721879d6a 100644 --- a/src/object/portable.hpp +++ b/src/object/portable.hpp @@ -1,7 +1,7 @@ // $Id$ -// +// // SuperTux -// Copyright (C) 2005 Matthias Braun +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -12,15 +12,17 @@ // 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 this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA. +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + #ifndef __PORTABLE_H__ #define __PORTABLE_H__ #include "moving_object.hpp" +#include "direction.hpp" +#include "refcounter.hpp" /** * An object that inherits from this object is considered "portable" and can @@ -33,11 +35,19 @@ class Portable public: virtual ~Portable() { } - + /** * called each frame when the object has been grabbed. */ - virtual void grab(MovingObject& object, const Vector& pos) = 0; + virtual void grab(MovingObject& object, const Vector& pos, Direction dir) = 0; + + virtual void ungrab(MovingObject& , Direction ) + {} + + virtual bool is_portable() const + { + return true; + } }; #endif