mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-06 19:01:21 +03:00
Merged openengine into openmw
This commit is contained in:
commit
b4343431c6
53 changed files with 5503 additions and 4 deletions
54
libs/openengine/input/tests/dispatch_map_test.cpp
Normal file
54
libs/openengine/input/tests/dispatch_map_test.cpp
Normal file
|
@ -0,0 +1,54 @@
|
|||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "../dispatch_map.hpp"
|
||||
|
||||
using namespace OEngine::Input;
|
||||
|
||||
typedef DispatchMap::OutList OutList;
|
||||
typedef OutList::const_iterator Cit;
|
||||
|
||||
void showList(const DispatchMap::OutList &out)
|
||||
{
|
||||
for(Cit it = out.begin();
|
||||
it != out.end(); it++)
|
||||
{
|
||||
cout << " " << *it << endl;
|
||||
}
|
||||
}
|
||||
|
||||
void showAll(DispatchMap &map)
|
||||
{
|
||||
cout << "\nPrinting everything:\n";
|
||||
for(DispatchMap::Iit it = map.map.begin();
|
||||
it != map.map.end(); it++)
|
||||
{
|
||||
cout << it->first << ":\n";
|
||||
showList(map.getList(it->first));
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
cout << "Testing the dispatch map\n";
|
||||
|
||||
DispatchMap dsp;
|
||||
|
||||
dsp.bind(1,9);
|
||||
dsp.bind(2,-5);
|
||||
dsp.bind(2,9);
|
||||
dsp.bind(3,10);
|
||||
dsp.bind(3,12);
|
||||
dsp.bind(3,10);
|
||||
|
||||
showAll(dsp);
|
||||
|
||||
dsp.unbind(1,9);
|
||||
dsp.unbind(5,8);
|
||||
dsp.unbind(3,11);
|
||||
dsp.unbind(3,12);
|
||||
dsp.unbind(3,12);
|
||||
|
||||
showAll(dsp);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue