src/Rope.hh
author ekku
Sat, 06 Dec 2008 19:38:01 +0000
changeset 225 22ecb9cb9245
child 228 dbc1bb7a98b5
permissions -rw-r--r--
Rope can be drawn.
#ifndef ROPE_HH
#define ROPE_HH

// Pre-declarations since rope wants to know the Player
// and the Player wants to know the rope.
class Rope;

#include "Player.hh"
#include "PhysicsObject.hh"

enum RopeState { FOLDED, FLYING, FIXED };

class Rope : public PhysicsObject {
private:
    Player &pl;
    // How long is the rope in its static state
    float length;
    virtual void onCollision (void);
    RopeState rs;
public:
    Rope(Player &climber);

    void shoot (void);
    void release (void);
    RopeState getState (void);
    virtual void draw(CL_GraphicContext *gc) const;
};

#endif