2007-05-27 12:01:53 -04:00
|
|
|
// $Id$
|
|
|
|
//
|
|
|
|
// SuperTuxKart - a fun racing game with go-kart
|
|
|
|
// Copyright (C) 2004-2006 Ingo Ruhnke <grumbel@gmx.de>
|
|
|
|
// Copyright (C) 2006 Joerg Henirchs, Ingo Ruhnke <grumbel@gmx.de>
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-06-12 20:53:52 -04:00
|
|
|
// as published by the Free Software Foundation; either version 3
|
2007-05-27 12:01:53 -04:00
|
|
|
// 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
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// 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.
|
|
|
|
|
2008-07-29 01:38:30 -04:00
|
|
|
#ifndef HEADER_GRAND_PRIX_DATA_H
|
|
|
|
#define HEADER_GRAND_PRIX_DATA_H
|
2007-05-27 12:01:53 -04:00
|
|
|
|
2007-09-10 13:03:31 -04:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <cassert>
|
|
|
|
|
2008-07-29 01:38:30 -04:00
|
|
|
/** Simple class that hold the data relevant to a 'grand_prix', aka. a number
|
2007-05-27 12:01:53 -04:00
|
|
|
of races that has to be completed one after the other */
|
2008-07-29 01:38:30 -04:00
|
|
|
class GrandPrixData
|
2007-05-27 12:01:53 -04:00
|
|
|
{
|
2008-07-29 01:38:30 -04:00
|
|
|
std::string m_name; // The name of the grand prix - might be translated!
|
|
|
|
std::string m_id; // Internal name of the grand prix, not translated
|
2007-05-27 12:01:53 -04:00
|
|
|
std::string m_filename; // Original filename, only for error handling needed
|
|
|
|
std::string m_description; // Description for this track
|
2008-10-29 11:55:54 -04:00
|
|
|
std::string m_item_style; // item style which overwrites the track default
|
2008-07-29 01:38:30 -04:00
|
|
|
/** The ident of the tracks in this grand prix in their right order, ident
|
2007-05-27 12:01:53 -04:00
|
|
|
means the filename of the .track file without .track extension
|
|
|
|
(ie. 'volcano') */
|
|
|
|
std::vector<std::string> m_tracks;
|
2007-12-06 15:57:42 -05:00
|
|
|
/** The number of laps that each track should be raced, in the right
|
|
|
|
* order*/
|
|
|
|
std::vector<int> m_laps;
|
2007-05-27 12:01:53 -04:00
|
|
|
|
2007-09-10 13:03:31 -04:00
|
|
|
public:
|
|
|
|
|
2008-07-29 01:38:30 -04:00
|
|
|
/** Load the GrandPrixData from the given filename */
|
|
|
|
GrandPrixData (const std::string filename);
|
|
|
|
GrandPrixData () {}; // empty for initialising
|
1) Removed race_setup and race_mode data structures. All this
information is now only managed by the race_manager, no
more in-between objects to transfer information along.
2) The scores for grand prix are now defined in the stk_config.dat
file (10, 8, 6, 5, 4, .., 1, 0, 0) points
3) Bugfix: unlock information wasn't saved anymore. Added specific
saving after unlocking, plus re-inserted the 'generic' save
at the end of STK again.
4) bugfix/work around: Visual Studio complains about incompatible
iterators in sdldrv - apparently caused by using erase, and
then keep on using the iterator.
5) Fixed bug when running a race in a GP again (scores/times
were added each time).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1681 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2008-04-09 09:52:48 -04:00
|
|
|
const std::string& getName () const { return m_name; }
|
2008-07-29 00:30:44 -04:00
|
|
|
const std::string& getId () const { return m_id; }
|
1) Removed race_setup and race_mode data structures. All this
information is now only managed by the race_manager, no
more in-between objects to transfer information along.
2) The scores for grand prix are now defined in the stk_config.dat
file (10, 8, 6, 5, 4, .., 1, 0, 0) points
3) Bugfix: unlock information wasn't saved anymore. Added specific
saving after unlocking, plus re-inserted the 'generic' save
at the end of STK again.
4) bugfix/work around: Visual Studio complains about incompatible
iterators in sdldrv - apparently caused by using erase, and
then keep on using the iterator.
5) Fixed bug when running a race in a GP again (scores/times
were added each time).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1681 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2008-04-09 09:52:48 -04:00
|
|
|
const std::string& getDescription () const { return m_description; }
|
2008-10-29 11:55:54 -04:00
|
|
|
const std::string& getItemStyle () const { return m_item_style; }
|
1) Removed race_setup and race_mode data structures. All this
information is now only managed by the race_manager, no
more in-between objects to transfer information along.
2) The scores for grand prix are now defined in the stk_config.dat
file (10, 8, 6, 5, 4, .., 1, 0, 0) points
3) Bugfix: unlock information wasn't saved anymore. Added specific
saving after unlocking, plus re-inserted the 'generic' save
at the end of STK again.
4) bugfix/work around: Visual Studio complains about incompatible
iterators in sdldrv - apparently caused by using erase, and
then keep on using the iterator.
5) Fixed bug when running a race in a GP again (scores/times
were added each time).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1681 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2008-04-09 09:52:48 -04:00
|
|
|
const std::string& getFilename () const { return m_filename; }
|
2009-01-26 17:47:44 -05:00
|
|
|
const std::string& getTrack(size_t track_index) const { assert(track_index >= 0); assert(track_index < m_tracks.size());
|
1) Removed race_setup and race_mode data structures. All this
information is now only managed by the race_manager, no
more in-between objects to transfer information along.
2) The scores for grand prix are now defined in the stk_config.dat
file (10, 8, 6, 5, 4, .., 1, 0, 0) points
3) Bugfix: unlock information wasn't saved anymore. Added specific
saving after unlocking, plus re-inserted the 'generic' save
at the end of STK again.
4) bugfix/work around: Visual Studio complains about incompatible
iterators in sdldrv - apparently caused by using erase, and
then keep on using the iterator.
5) Fixed bug when running a race in a GP again (scores/times
were added each time).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1681 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2008-04-09 09:52:48 -04:00
|
|
|
return m_tracks[track_index]; }
|
|
|
|
const std::vector<std::string>& getTracks() const {return m_tracks; }
|
|
|
|
const std::vector<int>& getLaps() const {return m_laps; }
|
|
|
|
size_t getTrackCount() const {return m_tracks.size(); }
|
|
|
|
const int& getLaps(size_t lap_index) const {assert(lap_index < m_tracks.size());
|
2008-07-29 01:38:30 -04:00
|
|
|
return m_laps[lap_index];}
|
2008-07-29 00:30:44 -04:00
|
|
|
bool checkConsistency();
|
2007-05-27 12:01:53 -04:00
|
|
|
}
|
2008-07-29 01:38:30 -04:00
|
|
|
; // GrandPrixData
|
2007-05-27 12:01:53 -04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* EOF */
|