Back to index

supertuxkart  0.5+dfsg1
kart_properties_manager.hpp
Go to the documentation of this file.
00001 //  $Id: kart_properties_manager.hpp 2111 2008-05-31 07:04:30Z cosmosninja $
00002 //
00003 //  SuperTuxKart - a fun racing game with go-kart
00004 //  Copyright (C) 2004-2006 Ingo Ruhnke <grumbel@gmx.de>
00005 //
00006 //  This program is free software; you can redistribute it and/or
00007 //  modify it under the terms of the GNU General Public License
00008 //  as published by the Free Software Foundation; either version 2
00009 //  of the License, or (at your option) any later version.
00010 //
00011 //  This program is distributed in the hope that it will be useful,
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //  GNU General Public License for more details.
00015 //
00016 //  You should have received a copy of the GNU General Public License
00017 //  along with this program; if not, write to the Free Software
00018 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019 
00020 #ifndef HEADER_KARTPROPERTIESMANAGER_H
00021 #define HEADER_KARTPROPERTIESMANAGER_H
00022 
00023 #include <vector>
00024 //#include "kart_properties.hpp"
00025 class KartProperties;
00026 
00027 class KartPropertiesManager
00028 {
00029 protected:
00030     float m_max_steer_angle;
00031 
00032     typedef std::vector<KartProperties*> KartPropertiesVector;
00034     KartPropertiesVector m_karts_properties;
00035 
00036 public:
00037     KartPropertiesManager();
00038     ~KartPropertiesManager();
00039        
00040        // vector containing kart numbers that have been selected in multiplayer
00041        // games.  This it used to ensure the same kart can not be selected more
00042        // than once.
00043     std::vector<int>         m_selected_karts;  
00044     
00045     const KartProperties*    getKartById            (int i);
00046     const KartProperties*    getKart                (const std::string IDENT);
00047     const int                getKartId              (const std::string IDENT);
00048     void                     loadKartData           (bool dont_load_models=false);
00049     const float              getMaximumSteeringAngle() {return m_max_steer_angle;}
00050     const unsigned int       getNumberOfKarts       () {return (unsigned int)m_karts_properties.size();}
00051 
00053     std::vector<std::string> getRandomKarts         (int len);
00054 
00056     void fillWithRandomKarts (std::vector<std::string>& vec);
00057     void removeTextures      ();
00058 };
00059 
00060 extern KartPropertiesManager *kart_properties_manager;
00061 
00062 #endif
00063 
00064 /* EOF */