forked from supertuxkart/stk-code
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathfixed_scoring.cpp
More file actions
44 lines (39 loc) · 1.67 KB
/
fixed_scoring.cpp
File metadata and controls
44 lines (39 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2025 kimden
//
// 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.
#include "utils/scoring/fixed_scoring.hpp"
void GPScoring::refreshCustomScores(int num_karts,
std::vector<int>& score_for_position)
{
score_for_position.clear();
for (unsigned i = 2; i < m_params.size(); i++)
score_for_position.push_back(m_params[i]);
score_for_position.resize(num_karts, 0);
} // refreshCustomScores
int GPScoring::getScoreForPosition(int p, float time,
std::map<int, float>& race_times,
const std::vector<int>& score_for_position) const
{
race_times[p] = time;
return score_for_position[p - 1];
} // getScoreForPosition
//-----------------------------------------------------------------------------
bool GPScoring::canGetScoreForPosition(int p, const std::map<int, float>& race_times) const
{
return true;
} // canGetScoreForPosition
//-----------------------------------------------------------------------------