Pol  Revision:cb584c9
startloc.cpp
Go to the documentation of this file.
1 
7 #include "startloc.h"
8 
9 #include "../clib/random.h"
10 
11 namespace Pol
12 {
13 namespace Core
14 {
16 {
17  int sidx = Clib::random_int( static_cast<int>( coords.size() - 1 ) );
18 
19  return coords[sidx];
20 }
21 
23 {
24  size_t size = city.capacity() + desc.capacity() + sizeof( Realms::Realm* ) /*realm*/
25  + sizeof( unsigned short ) /*mapid*/
26  + sizeof( unsigned long ) /*cliloc_desc*/
27  + 3 * sizeof( Coordinate* ) + coords.capacity() * sizeof( Coordinate );
28  return size;
29 }
30 }
31 }
int random_int(int i)
Definition: random.cpp:34
std::vector< Coordinate > coords
Definition: startloc.h:46
Coordinate select_coordinate() const
Definition: startloc.cpp:15
Definition: berror.cpp:12
size_t estimateSize() const
Definition: startloc.cpp:22