2012-12-16 19:33:47 -05:00
|
|
|
//
|
|
|
|
// SuperTuxKart - a fun racing game with go-kart
|
2013-11-15 06:43:21 -05:00
|
|
|
// Copyright (C) 2012-2013 Joerg Henrichs
|
2012-12-16 19:33:47 -05:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 3
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
#ifndef EASTER_EGG_HUNT_HPP
|
|
|
|
#define EASTER_EGG_HUNT_HPP
|
|
|
|
|
2013-11-08 16:42:49 -05:00
|
|
|
#include "modes/linear_world.hpp"
|
2012-12-16 19:33:47 -05:00
|
|
|
#include "states_screens/race_gui_base.hpp"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class AbstractKart;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief An implementation of World to provide an easter egg hunt like mode
|
|
|
|
* \ingroup modes
|
|
|
|
*/
|
2013-11-08 16:42:49 -05:00
|
|
|
class EasterEggHunt: public LinearWorld
|
2012-12-16 19:33:47 -05:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
/** Keeps track of how many eggs each kart has found. */
|
|
|
|
std::vector<int> m_eggs_collected;
|
|
|
|
|
|
|
|
/** Overall number of easter eggs. */
|
|
|
|
int m_number_of_eggs;
|
|
|
|
|
|
|
|
/** Number of eggs found so far. */
|
|
|
|
int m_eggs_found;
|
|
|
|
public:
|
|
|
|
EasterEggHunt();
|
|
|
|
virtual ~EasterEggHunt();
|
2013-05-30 15:47:39 -04:00
|
|
|
|
2012-12-16 19:33:47 -05:00
|
|
|
virtual void init();
|
2013-05-30 15:47:39 -04:00
|
|
|
|
2012-12-16 19:33:47 -05:00
|
|
|
virtual bool isRaceOver();
|
2013-05-30 15:47:39 -04:00
|
|
|
|
2012-12-16 19:33:47 -05:00
|
|
|
// overriding World methods
|
2013-04-03 02:05:34 -04:00
|
|
|
virtual void reset();
|
2012-12-16 19:33:47 -05:00
|
|
|
|
|
|
|
virtual bool raceHasLaps(){ return false; }
|
2013-05-30 15:47:39 -04:00
|
|
|
|
2012-12-16 19:33:47 -05:00
|
|
|
virtual const std::string& getIdent() const;
|
2013-11-15 07:52:39 -05:00
|
|
|
virtual void terminateRace();
|
2012-12-16 19:33:47 -05:00
|
|
|
virtual void update(float dt);
|
|
|
|
virtual void getKartsDisplayInfo(
|
|
|
|
std::vector<RaceGUIBase::KartIconDisplayInfo> *info);
|
2013-05-30 15:47:39 -04:00
|
|
|
|
2012-12-16 19:33:47 -05:00
|
|
|
void updateKartRanks();
|
|
|
|
void collectedEasterEgg(const AbstractKart *kart);
|
|
|
|
void readData(const std::string &filename);
|
2013-11-08 16:42:49 -05:00
|
|
|
|
|
|
|
virtual void checkForWrongDirection(unsigned int i) OVERRIDE;
|
2013-11-20 20:50:46 -05:00
|
|
|
virtual float estimateFinishTimeForKart(AbstractKart* kart) OVERRIDE;
|
|
|
|
|
2012-12-16 19:33:47 -05:00
|
|
|
}; // EasterEggHunt
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|