Galactic Bloodshed
gb
creator
namegen.cc
Go to the documentation of this file.
1
// Copyright 2014 The Galactic Bloodshed Authors. All rights reserved.
2
// Use of this source code is governed by a license that can be
3
// found in the COPYING file.
4
5
/**
6
* Different name generator implementations.
7
*/
8
9
#
include
"gb/creator/namegen.h"
10
#
include
<
sstream
>
11
12
bool
SequentialNameGenerator::next() {
13
std::ostringstream out;
14
out << prefix << currval << suffix;
15
currval++;
16
current_value = out.str();
17
return
true
;
18
}
19
20
bool
IterativeNameGenerator::next() {
21
current_value =
""
;
22
if
(head == tail) {
23
return
false
;
24
}
25
current_value = *head;
26
++head;
27
return
true
;
28
}
Generated by
1.8.13