Pol
Revision:cb584c9
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
{
15
Coordinate
StartingLocation::select_coordinate
()
const
16
{
17
int
sidx =
Clib::random_int
( static_cast<int>(
coords
.size() - 1 ) );
18
19
return
coords
[sidx];
20
}
21
22
size_t
StartingLocation::estimateSize
()
const
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
}
Pol::Realms::Realm
Definition:
realm.h:58
startloc.h
Pol::Core::StartingLocation::desc
std::string desc
Definition:
startloc.h:37
Pol::Core::Coordinate
Definition:
startloc.h:21
Pol::Clib::random_int
int random_int(int i)
Definition:
random.cpp:34
Pol::Core::StartingLocation::coords
std::vector< Coordinate > coords
Definition:
startloc.h:46
Pol::Core::StartingLocation::city
std::string city
Definition:
startloc.h:36
Pol::Core::StartingLocation::select_coordinate
Coordinate select_coordinate() const
Definition:
startloc.cpp:15
Pol
Definition:
berror.cpp:12
Pol::Core::StartingLocation::estimateSize
size_t estimateSize() const
Definition:
startloc.cpp:22
pol
startloc.cpp
Generated on Wed Oct 10 2018 02:42:28 for Pol by
1.8.11