Now reversing check structures order.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/reverse_mode@10824 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
c3a9c03b8b
commit
01458892f0
@ -19,6 +19,7 @@
|
||||
#include "tracks/check_manager.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
#include "io/xml_node.hpp"
|
||||
#include "tracks/ambient_light_sphere.hpp"
|
||||
@ -67,7 +68,26 @@ CheckManager::~CheckManager()
|
||||
/** Reverse checks order. */
|
||||
void CheckManager::reverse()
|
||||
{
|
||||
// FIXME
|
||||
std::map<unsigned int, std::vector<unsigned int> > structures_to_change_state;
|
||||
std::vector<CheckStructure*>::iterator it;
|
||||
for(unsigned int i=0;i<m_all_checks.size(); ++i)
|
||||
{
|
||||
for(std::vector<int>::const_iterator it = m_all_checks[i]->m_check_structures_to_change_state.begin();
|
||||
it != m_all_checks[i]->m_check_structures_to_change_state.end(); ++it)
|
||||
{
|
||||
if(*it>=0)
|
||||
{
|
||||
structures_to_change_state[*it].push_back(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(unsigned int i=0;i<m_all_checks.size(); ++i)
|
||||
{
|
||||
m_all_checks[i]->m_check_structures_to_change_state.clear();
|
||||
m_all_checks[i]->m_check_structures_to_change_state.resize(structures_to_change_state[i].size());
|
||||
copy(structures_to_change_state[i].begin(),structures_to_change_state[i].end(),
|
||||
m_all_checks[i]->m_check_structures_to_change_state.begin());
|
||||
}
|
||||
} // reverse
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -47,6 +47,7 @@ class CheckManager;
|
||||
*/
|
||||
class CheckStructure
|
||||
{
|
||||
friend class CheckManager;
|
||||
public:
|
||||
/** Different types of check structures:
|
||||
* ACTIVATE: Activates another check structure (independent of
|
||||
|
Loading…
x
Reference in New Issue
Block a user