Back to index

extremetuxracer  0.5beta
pp_classes.h
Go to the documentation of this file.
00001 /* 
00002  * PPRacer 
00003  * Copyright (C) 2004-2005 Volker Stroebel <volker@planetpenguin.de>
00004  * 
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 
00020 #ifndef _PP_CLASSES_H_
00021 #define _PP_CLASSES_H_
00022 
00023 #include "pp_types.h"
00024 #include "etracer.h"
00025 
00026 #include "ppgltk/model.h"
00027 
00028 
00029 class BaseItem {
00030 public:
00031        ray_t ray;
00032        double height;
00033     double diam;
00034     int type;
00035 };
00036 
00037 class Item : public BaseItem {
00038 public:
00039 
00040        enum Type{
00041               UNCOLLECTABLE,
00042               HERRING,
00043               LIFE   
00044        };
00045        
00046 private:      
00047        bool m_drawable;
00048        bool m_collected;
00049        Type m_type;
00050        int m_score;
00051 
00052 public:
00053        Item():m_collected(false){};
00054 
00055        inline bool isDrawable(){ return m_drawable; };
00056        inline void setDrawable(const bool state=true){ m_drawable=state; };
00057 
00058        inline int getScore(){return m_score;}
00059        inline void setScore(const int score){m_score=score;}
00060        
00061        inline Type getType(){return m_type;};
00062        inline void setType(Type type){m_type=type;};
00063        
00064        inline void setCollected(bool collected=true){m_collected=collected;};
00065        inline bool isCollected(){return m_collected;};
00066 };
00067 
00068 class Tree : public BaseItem {
00069        pp::Model* mp_model;
00070        pp::Polyhedron* mp_ph;
00071        
00072 public:
00073        inline void setPolyhedron(pp::Polyhedron* ph){mp_ph = ph;};
00074        inline pp::Polyhedron* getPolyhedron(){return mp_ph;};
00075        inline void setModel(pp::Model* model){mp_model = model;};
00076        inline pp::Model* getModel(){return mp_model;}   
00077 };
00078 
00079 #endif // PP_CLASSES_H_