RigsofRods
Soft-body Physics Simulation
RaceSystem.h
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5  Copyright 2015-2020 Petr Ohlidal
6 
7  For more information, see http://www.rigsofrods.org/
8 
9  Rigs of Rods is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License version 3, as
11  published by the Free Software Foundation.
12 
13  Rigs of Rods is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #pragma once
23 
26 
27 #include <Ogre.h>
28 
29 namespace RoR {
30 
32 {
33 public:
34  void StartRaceTimer(int id);
35  void StopRaceTimer();
36  bool IsRaceInProgress() const { return m_race_id != -1; }
37  int GetRaceId() const { return m_race_id; }
38  float GetRaceTime() const;
39 
40  void SetRaceTimeDiff(float diff) { m_race_time_diff = diff; };
41  float GetRaceTimeDiff() const { return m_race_time_diff; };
42 
43  void SetRaceBestTime(float time) { m_race_best_time = time; };
44  float GetRaceBestTime() const { return m_race_best_time; };
45 
46  void UpdateDirectionArrow(char* text, Ogre::Vector3 position);
47  Ogre::Vector3 GetDirArrowTarget() { return m_dir_arrow_target; }
48  std::string const& GetDirArrowText() const { return m_dir_arrow_text; }
49  bool IsDirArrowVisible() const { return m_dir_arrow_visible; }
50 
51 private:
52  bool m_dir_arrow_visible = false;
53  std::string m_dir_arrow_text;
54  Ogre::Vector3 m_dir_arrow_target = Ogre::Vector3::ZERO;
55 
56  int m_race_id = -1;
57  float m_race_time_diff = 0.f;
58  float m_race_best_time = 0.f;
59  float m_race_start_time = 0.f;
60 };
61 
62 } // namespace RoR
RoR::RaceSystem::GetRaceId
int GetRaceId() const
Definition: RaceSystem.h:37
RoR::RaceSystem::UpdateDirectionArrow
void UpdateDirectionArrow(char *text, Ogre::Vector3 position)
Definition: RaceSystem.cpp:31
RoR::RaceSystem::m_dir_arrow_target
Ogre::Vector3 m_dir_arrow_target
Definition: RaceSystem.h:54
RoR::RaceSystem
Definition: RaceSystem.h:31
RoR::RaceSystem::SetRaceBestTime
void SetRaceBestTime(float time)
Definition: RaceSystem.h:43
RoR::RaceSystem::GetDirArrowText
std::string const & GetDirArrowText() const
Definition: RaceSystem.h:48
RoR::RaceSystem::IsDirArrowVisible
bool IsDirArrowVisible() const
Definition: RaceSystem.h:49
RoR::RaceSystem::GetRaceTime
float GetRaceTime() const
Definition: RaceSystem.cpp:59
RoR::RaceSystem::m_race_start_time
float m_race_start_time
Definition: RaceSystem.h:59
RoR::RaceSystem::GetRaceTimeDiff
float GetRaceTimeDiff() const
Definition: RaceSystem.h:41
RoR::RaceSystem::m_dir_arrow_text
std::string m_dir_arrow_text
Definition: RaceSystem.h:53
RoR::RaceSystem::StopRaceTimer
void StopRaceTimer()
Definition: RaceSystem.cpp:53
RoR::RaceSystem::m_race_id
int m_race_id
Definition: RaceSystem.h:56
RoR::RaceSystem::GetDirArrowTarget
Ogre::Vector3 GetDirArrowTarget()
Definition: RaceSystem.h:47
RoR::RaceSystem::m_race_best_time
float m_race_best_time
Definition: RaceSystem.h:58
RoR::RaceSystem::StartRaceTimer
void StartRaceTimer(int id)
Definition: RaceSystem.cpp:46
RoR::RaceSystem::m_race_time_diff
float m_race_time_diff
Definition: RaceSystem.h:57
RoR::RaceSystem::GetRaceBestTime
float GetRaceBestTime() const
Definition: RaceSystem.h:44
RoR::RaceSystem::m_dir_arrow_visible
bool m_dir_arrow_visible
Definition: RaceSystem.h:52
RoR::RaceSystem::IsRaceInProgress
bool IsRaceInProgress() const
Definition: RaceSystem.h:36
RoR::RaceSystem::SetRaceTimeDiff
void SetRaceTimeDiff(float diff)
Definition: RaceSystem.h:40
RoR
Definition: AppContext.h:36