summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.h
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-25 10:43:02 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-25 10:43:02 +0000
commita0d48b01861f3745455c731078bc2b15187b1050 (patch)
tree2f94da2a304d427bd2859f740ee170c1f1945c00 /crawl-ref/source/libutil.h
parentbe875338f295eb1a2c97e33e6444907f3b492e7d (diff)
downloadcrawl-ref-a0d48b01861f3745455c731078bc2b15187b1050.tar.gz
crawl-ref-a0d48b01861f3745455c731078bc2b15187b1050.zip
Removed USE_NEW_RANDOM, USE_MACROS.
Removed DOS_TERM, PLAIN_TERM special casery - all platforms get PLAIN_TERM. Better end-of-greedy-explore reporting for items on traps (Erik). Cleaned up find_travel_pos - moved guts of travel pathfinding to travel_pathfind class. Miscellaneous other stuff. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@882 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libutil.h')
-rw-r--r--crawl-ref/source/libutil.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h
index be30ec5ebd..5ad02e504e 100644
--- a/crawl-ref/source/libutil.h
+++ b/crawl-ref/source/libutil.h
@@ -80,8 +80,10 @@ inline std::string lowercase_first(std::string s)
return (s);
}
-template <class Z>
-std::string comma_separated_line(Z start, Z end)
+template <typename Z>
+std::string comma_separated_line(Z start, Z end,
+ const std::string &andc = " and ",
+ const std::string &comma = ", ")
{
std::string text;
for (Z i = start; i != end; ++i)
@@ -89,9 +91,9 @@ std::string comma_separated_line(Z start, Z end)
if (i != start)
{
if (i + 1 != end)
- text += ", ";
+ text += comma;
else
- text += " and ";
+ text += andc;
}
text += *i;