summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/MSVC
diff options
context:
space:
mode:
authorPete Hurst <pete@streamuniverse.tv>2013-06-22 20:34:41 +0100
committerPete Hurst <pete@streamuniverse.tv>2013-06-23 02:43:28 +0100
commit0e5d46227251053be2ac5fb92cba2427c9c42b20 (patch)
tree1e208212c0030d59dff08393d05c946a92c73429 /crawl-ref/source/MSVC
parent94225b818f4224d364b89af2accef481d8af3f80 (diff)
downloadcrawl-ref-0e5d46227251053be2ac5fb92cba2427c9c42b20.tar.gz
crawl-ref-0e5d46227251053be2ac5fb92cba2427c9c42b20.zip
Rework mon-pick algorithm as a class template
This enables the distributions to be easily used for picking over enums other than monster_type, and even for arbitrary objects. The new template is contained in random_pick. It can be used simply by creating a random_picker<T> and calling its pick method, or can be subclassed if more complex veto behaviour is required.
Diffstat (limited to 'crawl-ref/source/MSVC')
-rw-r--r--crawl-ref/source/MSVC/crawl.vcxproj1
-rw-r--r--crawl-ref/source/MSVC/crawl.vcxproj.filters1
2 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/MSVC/crawl.vcxproj b/crawl-ref/source/MSVC/crawl.vcxproj
index a0456cb7e3..7c1cb59f9f 100644
--- a/crawl-ref/source/MSVC/crawl.vcxproj
+++ b/crawl-ref/source/MSVC/crawl.vcxproj
@@ -794,6 +794,7 @@ perl.exe "util/gen-cflg.pl" compflag.h "&lt;UNKNOWN&gt;" "&lt;UNKNOWN&gt;"
<ClInclude Include="..\process_desc.h" />
<ClInclude Include="..\props.h" />
<ClInclude Include="..\quiver.h" />
+ <ClInclude Include="..\random-pick.h" />
<ClInclude Include="..\random-var.h" />
<ClInclude Include="..\random-weight.h" />
<ClInclude Include="..\random.h" />
diff --git a/crawl-ref/source/MSVC/crawl.vcxproj.filters b/crawl-ref/source/MSVC/crawl.vcxproj.filters
index 6d5b72b99f..c49de7a8bd 100644
--- a/crawl-ref/source/MSVC/crawl.vcxproj.filters
+++ b/crawl-ref/source/MSVC/crawl.vcxproj.filters
@@ -612,5 +612,6 @@
<ClInclude Include="..\zotdef.h" />
<ClInclude Include="..\dgn-irregular-box.h" />
<ClInclude Include="..\mon-chimera.h" />
+ <ClInclude Include="..\random-pick.h" />
</ItemGroup>
</Project> \ No newline at end of file