dfhack/plugins
Josh Cooper 23b2d5eba5 Merge branch cxxrandom
Implements helper functions for random number generation.
Implemented using C++11 <random> library.

Exported Lua Functions:
- seedRNG(seed)
- rollInt(min, max)
- rollDouble(min, max)
- rollNormal(mean, std_deviation)
- rollBool(chance_for_true)
- resetIndexRolls(string, array_length)  --String identifies the instance of SimpleNumDistribution to reset
- rollIndex(string, array_length)        --String identifies the instance of SimpleNumDistribution to use
                                         --(Shuffles a vector of indices, Next() increments through then reshuffles when end() is reached)

 On branch cxxrandom-rel
 Changes to be committed:
   modified:   plugins/CMakeLists.txt
   new file:   plugins/cxxrandom.cpp
   new file:   plugins/lua/cxxrandom.lua

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Squashed commit of the following:

commit 3a7ef70d45f3e0c2fe367141dd0349dddaaff60d
Merge: fd9f1982 7aa0608c
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Fri Dec 22 22:17:27 2017 -0800

    Merge remote-tracking branch 'origin/temp' into cxxrandom

commit 7aa0608cb85dcf82686193db7a6e9d1318f5f2a5
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Thu Dec 21 21:43:35 2017 -0800

    Revises cxxrandom plugin

    New functions:
    - seedRNG(ushort seed)
        --lua exported
    - GetDistribContainer()
        --internal singleton
    - RNG()
        --internal singleton

    Summary:
    - Removed class CXXRNG
        --Refactored functions that used CXXRNG

     Changes to be committed:
            modified:   plugins/cxxrandom.cpp

commit b42979818a01c1121eace7b1ac14676f5ad5d8b2
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Wed Dec 20 13:21:49 2017 -0800

    Fixes plugin_init()

    Misread the lines indicated by lethosor to be excluded, had broken the plugin in the process.
     Changes to be committed:
    	modified:   plugins/cxxrandom.cpp

commit 753a00a14d9e6519d299638e014abf30509940af
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Wed Dec 20 12:36:17 2017 -0800

    Cleans up cxxrandom.cpp

    DFHack contributions specifies:
    -spaces instead of tabs, so tabs were converted.
    -C++ headers before dfhack stuff, so it was done

    *Also added author name, creation date, and last updated date.

     Changes to be committed:
    	modified:   plugins/cxxrandom.cpp

commit 498ebe4b8fdccc01ac1f169269f3093c830a8a10
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Tue Dec 19 22:51:58 2017 -0800

    Updates cxxrandom, fixes instance leak

    deleted header
    moved definition to cpp file #lethosor

    fixed singleton instance, no longer a pointer
    commented out dfhack commands, now only init/shutdown and exported lua functions

    	modified:   cxxrandom.cpp
    	deleted:    cxxrandom.h

commit 821044bef2a0201d0d74192e445c7b29766b42a1
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Sun Dec 17 04:01:11 2017 -0800

    Fixes RollIndex and Renames RollNormal

    Renamed the Normal Distribution RNG function to fit the standard.
    Now named RollNormal(m,s)

    Fixed some wonky white space in the lua macro export block.

    Fixed a stupid mistake with the RollIndex output. (it was outputting 0's)

    Updated usage details.

     Changes to be committed:
    	modified:   plugins/cxxrandom.cpp

commit 1536f43d137b6bc55d55759b43bdccf6ff429b33
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Fri Dec 15 08:50:08 2017 -0800

    Fixes/Improves cxxrandom

    Modified return types
    Corrected index distribution code

commit 8629c7e1509522cb0cc4b649914b90d033cb4763
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Thu Dec 14 19:02:29 2017 -0800

    Implements SimpleNumDistribution

    Exported additional functions to lua.
    Functions allow the generation of random 0-N index values.
    Generation promises all unique values [0,N] will be returned once each when generation is run N times.

     On branch cxxrandom
     Changes to be committed:
    	modified:   plugins/cxxrandom.cpp
    	modified:   plugins/cxxrandom.h

commit f035f3d20415790542cf83e5e696261661d911f3
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Wed Dec 13 23:55:39 2017 -0800

    Implements cxxrandom

    cxxrandom was implemented using a singleton.
    This singleton provides an interface for generating uniform numbers, or numbers in a normal distribution, and also booleans(given the probability for the true outcome)
    The singleton interface is wrapped in functions which are exposed for lua usage.

    Integrated into plugins/CMakeLists.txt

     On branch dev
     Changes to be committed:
    	modified:   CMakeLists.txt
    	new file:   cxxrandom.cpp
    	new file:   cxxrandom.h
    	new file:   lua/cxxrandom.lua
2018-04-29 21:08:44 -07:00
..
devel Many build fixes 2018-03-10 16:53:45 -05:00
diggingInvaders Update xml and all uses of job_handler 2017-11-25 00:59:59 -05:00
embark-assistant embark-assistant: fix copy-paste error, update docs (#1231) 2018-03-14 09:28:24 -04:00
isoworld@fbbf9e4645 Partial preparation for 0.44.07-alpha1. 2018-03-13 15:49:42 -05:00
labormanager Merge remote-tracking branches 'ab9rf/digtype-1243' and 'ab9rf/labormanager-map-check-bug' into develop 2018-04-02 00:56:33 -04:00
lua Merge branch cxxrandom 2018-04-29 21:08:44 -07:00
proto add ocean waves to RFR 2018-03-14 16:08:37 +05:30
raw Fix reaction errors, make quantities more consistent 2014-02-13 11:37:04 -06:00
remotefortressreader Merge remote-tracking branch 'DFHack/develop' into remote_reader 2018-03-14 16:18:03 +05:30
rendermax Merge ui_area_map_width into ui_menu_width, now a 2-byte array 2017-12-03 20:34:59 -06:00
ruby Merge ui_area_map_width into ui_menu_width, now a 2-byte array 2017-12-03 20:34:59 -06:00
skeleton Update skeleton plugin 2014-12-06 20:55:57 -05:00
stockpiles max_barrels was serialized on max_bins position 2017-08-28 22:33:24 +02:00
stonesense@0430344c7b Update stonesense 2018-03-14 09:40:21 -04:00
tweak Add tweak that replaces dwarf mode FPS counter with one that does not count when paused 2018-02-03 17:58:24 +01:00
.keep Making ready for adding plugins. Fixes all over the place, more removal of obsolete parts. 2011-06-20 01:12:07 +02:00
3dveins.cpp Include math.h 2016-05-22 16:45:58 -04:00
Brushes.h Avoid polluting global namespace in MapCache.h 2016-10-15 14:53:10 -04:00
CMakeLists.custom.txt Allow adding plugins temporarily without modifying plugins/CMakeLists.txt 2015-11-17 17:42:03 -05:00
CMakeLists.txt Merge branch cxxrandom 2018-04-29 21:08:44 -07:00
Plugins.cmake Add .proto files to plugin sources when used, to make it conventient to open it from the IDE. 2016-11-08 15:10:01 +05:30
add-spatter.cpp Many build fixes 2018-03-10 16:53:45 -05:00
advtools.cpp Partial compilation fixes for advtools, misery 2016-11-16 15:21:13 -05:00
autochop.cpp Show number of trees skipped 2018-02-10 03:03:07 -05:00
autodump.cpp Move ListColumn class to a separate header 2015-07-28 21:48:00 -04:00
autogems.cpp adjust autogems to work with the workshop profile changes 2016-05-14 20:15:49 -05:00
autohauler.cpp Add new PutItemOnDisplay job to labor management plugins 2017-12-27 13:48:53 -05:00
autolabor.cpp Add new PutItemOnDisplay job to labor management plugins 2017-12-27 13:48:53 -05:00
automaterial.cpp Add Gui::refreshSidebar() 2017-06-23 00:02:21 -04:00
automelt.cpp Shorten "ls" help for plugins 2016-04-15 16:28:41 +10:00
autotrade.cpp Move ListColumn class to a separate header 2015-07-28 21:48:00 -04:00
blueprint.cpp blueprint: fix compilation (i.e. undefined find) 2016-01-06 03:03:19 +03:00
building-hacks.cpp Avoid non-trivial bitfield constructors 2016-12-09 13:41:14 -05:00
buildingplan-lib.cpp buildingplan: Support floodgates, grates, bars 2016-01-31 14:50:07 -05:00
buildingplan-lib.h df::dfhack_material_category has no constructor, must be manually initialized 2016-12-18 17:58:24 -06:00
buildingplan.cpp Add Gui::refreshSidebar() 2017-06-23 00:02:21 -04:00
burrows.cpp Avoid non-trivial bitfield constructors 2016-12-09 13:41:14 -05:00
changeitem.cpp Fix whitespace issues 2015-02-14 22:53:06 -05:00
changelayer.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
changevein.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
cleanconst.cpp Update some plugins to use REQUIRE_GLOBAL 2014-12-03 23:26:54 -05:00
cleaners.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
cleanowned.cpp Update some plugins to use REQUIRE_GLOBAL 2014-12-03 23:26:54 -05:00
command-prompt.cpp Make re-invoking command-prompt hide the current prompt 2017-06-07 15:00:30 -04:00
confirm.cpp Fix multiple issues with the confirm plugin 2017-05-27 00:26:14 -04:00
createitem.cpp Simplify logic in createitem, to avoid similar errors in the future 2017-12-16 15:40:39 -06:00
cursecheck.cpp Update for 64-bit unit changes 2016-08-10 23:50:00 -04:00
cxxrandom.cpp Merge branch cxxrandom 2018-04-29 21:08:44 -07:00
deramp.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
dfstream.cpp Replace translate_socket_error() implementations with DescribeError() 2015-10-03 10:37:48 -04:00
dig.cpp check for tile material == MINERAL in digtype (#1243) 2018-03-20 01:44:10 -05:00
digFlood.cpp Update xml and all uses of job_handler 2017-11-25 00:59:59 -05:00
dwarfmonitor.cpp Many build fixes 2018-03-10 16:53:45 -05:00
dwarfvet.cpp Avoid crash in dwarfvet due to negative width/height 2018-02-16 15:12:46 -05:00
embark-tools.cpp embark-tools sand: hide indicator when it overlaps with confirmation window 2017-05-19 11:49:25 -04:00
eventful.cpp Many build fixes 2018-03-10 16:53:45 -05:00
fastdwarf.cpp Update for 64-bit unit changes 2016-08-10 23:50:00 -04:00
filltraffic.cpp Shorten "ls" help for plugins 2016-04-15 16:28:41 +10:00
fix-armory.cpp Merge ui_area_map_width into ui_menu_width, now a 2-byte array 2017-12-03 20:34:59 -06:00
fix-unit-occupancy.cpp fix-unit-occupancy: Account for wagon occupancy correctly 2015-12-31 13:38:38 -05:00
fixveins.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
flows.cpp Update remaining plugins to use REQUIRE_GLOBAL 2014-12-06 19:30:05 -05:00
follow.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
forceequip.cpp Shorten "ls" help for plugins 2016-04-15 16:28:41 +10:00
fortplan.cpp Shorten "ls" help for plugins 2016-04-15 16:28:41 +10:00
generated-creature-renamer.cpp Remove trailing whitespaces. 2017-02-08 10:54:42 +05:30
getplants.cpp Update getplants to use Designations module 2017-05-06 00:11:07 -04:00
hotkeys.cpp Shorten "ls" help for plugins 2016-04-15 16:28:41 +10:00
infiniteSky.cpp Shorten "ls" help for plugins 2016-04-15 16:28:41 +10:00
isoworldremote.cpp Move save_dir back into cur_savegame and update submodules 2016-08-14 12:41:09 -04:00
jobutils.cpp Update remaining plugins to use REQUIRE_GLOBAL 2014-12-06 19:30:05 -05:00
lair.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
liquids.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
listcolumn.h ListColumn: only change items' foreground color in selected columns 2018-01-18 10:05:31 -05:00
luasocket.cpp Update clsocket and Open()/Listen() usage 2016-06-14 13:21:51 -04:00
manipulator.cpp manipulator: show social activities in job column 2017-04-28 17:26:20 -04:00
misery.cpp Re-add and update misery plugin 2016-12-10 18:22:32 -05:00
mode.cpp Add built-in enable and disable commands. 2013-09-30 13:19:51 +04:00
mousequery.cpp Add Gui::refreshSidebar() 2017-06-23 00:02:21 -04:00
orders.cpp Fix fencepost error in orders import. Fixes #1177. 2017-10-16 14:01:23 -05:00
pathable.cpp Add new "pathable" plugin 2017-07-05 23:54:55 -04:00
petcapRemover.cpp Update for 64-bit unit changes 2016-08-10 23:50:00 -04:00
plants.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
power-meter.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
probe.cpp probe: display tiletype enum names as well 2017-05-10 12:40:57 -04:00
prospector.cpp update structures 2017-11-04 07:50:47 -06:00
regrass.cpp Fix whitespace issues 2015-02-14 22:53:06 -05:00
rename.cpp Update remaining plugins to use REQUIRE_GLOBAL 2014-12-06 19:30:05 -05:00
resume.cpp resume: use map y dimension and fix off-by-one error 2017-06-03 11:24:23 -04:00
reveal.cpp update structures 2017-11-04 07:50:47 -06:00
search.cpp Unit list search: reset cursor position to 0 before switching pages 2016-05-17 23:23:54 -04:00
seedwatch.cpp Shorten "ls" help for plugins 2016-04-15 16:28:41 +10:00
showmood.cpp Update xml and all uses of job_handler 2017-11-25 00:59:59 -05:00
siege-engine.cpp siege-engine: use map tiles 2017-05-31 12:12:52 -04:00
sort.cpp Update handling of viewscreen_workshop_profilest in Gui module, search/sort plugins 2016-05-14 11:43:37 -04:00
steam-engine.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
stockflow.cpp Update xml and all uses of job_handler 2017-11-25 00:59:59 -05:00
stocks.cpp Add Gui::refreshSidebar() 2017-06-23 00:02:21 -04:00
strangemood.cpp Fix silly error in strangemood plugin - missing "break;" statements in deep material item searches 2017-07-02 07:31:31 -06:00
tiletypes.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
title-folder.cpp title-folder: fix SDL path on OS X 2017-03-18 00:31:25 -04:00
title-version.cpp title-version: Hide when loading a game (e.g. arena) 2017-01-04 12:30:59 -05:00
trackstop.cpp Add "DFHack" indicator to trackstop menus 2015-02-17 14:13:53 -05:00
tubefill.cpp Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
uicommon.h uicommon: remove nullptr definition 2017-05-25 18:06:51 -04:00
versionosd.cpp Tweaks! 2012-03-29 18:37:22 +02:00
workNow.cpp Shorten "ls" help for plugins 2016-04-15 16:28:41 +10:00
workflow.cpp Update xml and all uses of job_handler 2017-11-25 00:59:59 -05:00
zone.cpp Merge ui_area_map_width into ui_menu_width, now a 2-byte array 2017-12-03 20:34:59 -06:00