Back to index

supertuxkart  0.5+dfsg1
cup_data.hpp
Go to the documentation of this file.
00001 //  $Id: cup_data.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 //  Copyright (C) 2006      Joerg Henirchs, Ingo Ruhnke <grumbel@gmx.de>
00006 //
00007 //  This program is free software; you can redistribute it and/or
00008 //  modify it under the terms of the GNU General Public License
00009 //  as published by the Free Software Foundation; either version 2
00010 //  of the License, or (at your option) any later version.
00011 //
00012 //  This program is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU General Public License
00018 //  along with this program; if not, write to the Free Software
00019 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 
00021 #ifndef HEADER_CUPDATA_H
00022 #define HEADER_CUPDATA_H
00023 
00024 #include <string>
00025 #include <vector>
00026 #include <cassert>
00027 
00028 #include "herring_manager.hpp"
00029 
00032 class CupData
00033 {
00034     std::string m_name;         // The name of the cup
00035     std::string m_filename;     // Original filename, only for error handling needed
00036     std::string m_description;  // Description for this track
00037     std::string m_herring_style; // herring style which overwrites the track default
00041     std::vector<std::string> m_tracks;
00044     std::vector<int> m_laps;
00045 
00046 public:
00047 
00049     CupData        (const std::string filename);
00050     CupData        ()       {}; // empty for initialising
00051     const std::string& getName        ()        const { return m_name;          }
00052     const std::string& getDescription ()        const { return m_description;   }
00053     const std::string& getHerringStyle()        const { return m_herring_style; }
00054     const std::string& getFilename    ()        const { return m_filename;      }
00055     const std::string& getTrack(size_t track_index) const { assert(track_index < m_tracks.size()); 
00056                                                        return m_tracks[track_index]; }
00057     const std::vector<std::string>& getTracks()  const {return m_tracks;        }
00058     const std::vector<int>&         getLaps()    const {return m_laps;          }
00059     size_t             getTrackCount()           const {return m_tracks.size(); }
00060     const int&         getLaps(size_t lap_index) const {assert(lap_index < m_tracks.size()); 
00061                                                          return m_laps[lap_index]; }
00062 }
00063 ;   // CupData
00064 
00065 #endif
00066 
00067 /* EOF */