SuperTuxKart
Loading...
Searching...
No Matches
check_lap.hpp
1//
2// SuperTuxKart - a fun racing game with go-kart
3// Copyright (C) 2010-2015 Joerg Henrichs
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 3
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19#ifndef HEADER_CHECK_LAP_HPP
20#define HEADER_CHECK_LAP_HPP
21
22#include "tracks/check_structure.hpp"
23#include "utils/cpp2011.hpp"
24
25class XMLNode;
26class CheckManager;
27
35{
36private:
38 std::vector<float> m_previous_distance;
39
40public:
41 CheckLap(const XMLNode &node, unsigned int index);
42 virtual ~CheckLap() {};
43 virtual bool isTriggered(const Vec3 &old_pos, const Vec3 &new_pos,
44 int indx) OVERRIDE;
45 virtual void reset(const Track &track) OVERRIDE;
46 virtual bool triggeringCheckline() const OVERRIDE { return true; }
47 // ------------------------------------------------------------------------
48 virtual CheckStructure* clone() OVERRIDE { return new CheckLap(*this); }
49}; // CheckLap
50
51#endif
52
Implements a simple lap test.
Definition: check_lap.hpp:35
std::vector< float > m_previous_distance
Store the previous distance along track.
Definition: check_lap.hpp:38
virtual CheckStructure * clone() OVERRIDE
Clone to child process for server usage (atm no sound or scripting).
Definition: check_lap.hpp:48
virtual void reset(const Track &track) OVERRIDE
Initialises the 'previous positions' of all karts with the start position defined for this track.
Definition: check_lap.cpp:44
virtual bool isTriggered(const Vec3 &old_pos, const Vec3 &new_pos, int indx) OVERRIDE
True if going from old_pos to new_pos crosses this checkline.
Definition: check_lap.cpp:61
Controls all checks structures of a track.
Definition: check_manager.hpp:40
Virtual base class for a check structure.
Definition: check_structure.hpp:52
Definition: track.hpp:114
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48