X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fobject%2Ficecrusher.hpp;h=00809375b9b8423a7f6f8a7e32b24c49377c0933;hb=08813a74da6ac1fd045a105e4e8105f1d7f716f0;hp=dfb255cfd61d0870665672f4161b4f32a5af1097;hpb=f406067af6cbeb0a638078fe1d386d092583909c;p=supertux.git diff --git a/src/object/icecrusher.hpp b/src/object/icecrusher.hpp index dfb255cfd..00809375b 100644 --- a/src/object/icecrusher.hpp +++ b/src/object/icecrusher.hpp @@ -1,12 +1,10 @@ -// $Id$ -// // IceCrusher - A block to stand on, which can drop down to crush the player // Copyright (C) 2008 Christoph Sommer // -// 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 2 -// of the License, or (at your option) any later version. +// 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 @@ -14,51 +12,49 @@ // 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. +// along with this program. If not, see . -#ifndef INCLUDED_ICECRUSHER_HPP -#define INCLUDED_ICECRUSHER_HPP +#ifndef HEADER_SUPERTUX_OBJECT_ICECRUSHER_HPP +#define HEADER_SUPERTUX_OBJECT_ICECRUSHER_HPP -#include -#include #include "object/moving_sprite.hpp" -#include "object/player.hpp" + +class Player; /** * This class is the base class for icecrushers that tux can stand on */ class IceCrusher : public MovingSprite { - public: - IceCrusher(const lisp::Lisp& reader); - IceCrusher(const IceCrusher& icecrusher); - virtual IceCrusher* clone() const { return new IceCrusher(*this); } - - virtual HitResponse collision(GameObject& other, const CollisionHit& hit); - virtual void collision_solid(const CollisionHit& hit); - virtual void update(float elapsed_time); - - const Vector& get_speed() const - { - return speed; - } - - protected: - enum IceCrusherState { - IDLE, - CRUSHING, - RECOVERING - }; - IceCrusherState state; - Vector start_position; - Vector speed; - - Player* get_nearest_player(); - bool found_victim(); - void set_state(IceCrusherState state, bool force = false); +public: + IceCrusher(const Reader& reader); + IceCrusher(const IceCrusher& icecrusher); + + virtual HitResponse collision(GameObject& other, const CollisionHit& hit); + virtual void collision_solid(const CollisionHit& hit); + virtual void update(float elapsed_time); + + const Vector& get_speed() const + { + return speed; + } + +protected: + enum IceCrusherState { + IDLE, + CRUSHING, + RECOVERING + }; + IceCrusherState state; + Vector start_position; + Vector speed; + + Player* get_nearest_player(); + bool found_victim(); + void set_state(IceCrusherState state, bool force = false); }; #endif + +/* EOF */