]>
jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/testdriver/main.cpp
7cd45a1b798c4826c57d872ee5016222150e29ec
3 #include <GameServ/GameLayer/GameObjects/PlayerGO.h>
4 using GameServ::GameLayer::GameObjects::PlayerGO
;
5 #include <GameServ/GameLayer/PlayerGL.h>
6 using GameServ::GameLayer::PlayerGL
;
8 #include <GameServ/GameServException.h>
9 using GameServ::Exceptions::GameServException
;
11 #include <GameServ/Types.h>
12 using GameServ::Types::Range
;
19 //shared_ptr<PlayerGO> spPlayer = pgl.GetById("Kain");
20 //cout << spPlayer->Name() << endl;
21 //spPlayer->Name("Kainazzzo");
22 //pgl.Insert(spPlayer);
25 map
<int, int> frequencies
;
27 for (x
= 0; x
< 10000; x
++)
29 Range
testrange(-100, 100);
30 int randnum
= testrange
.Random();
31 frequencies
[randnum
]++;
33 map
<int, int>::const_iterator iter
;
34 for (iter
= frequencies
.begin(); iter
!= frequencies
.end(); iter
++)
36 cout
<< iter
->first
<< ": ";
37 cout
<< (iter
->second
/ (double)(x
+ 1)) * 100 << '%' << endl
;
40 catch (GameServException
&e
)
42 cout
<< e
.VerboseError() << endl
;