diff options
author | Griffin Smith <root@gws.fyi> | 2019-07-28T02·16-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-07-28T02·16-0400 |
commit | f22bcad817ee354b355d29b6b289894e2d15cfaa (patch) | |
tree | 509aa3b88f834ffaccd6a90b61ae2c1e1567622d /src/level_gen/util.rs | |
parent | 68e8ad8a0e6a5ac38b34658f03807ade603a687c (diff) |
Add a generic text-prompt system
Add a generic text-prompt system to the Game, and use it to prompt the character for their name on startup. There's also a Promise type in util, which is used for the result of the prompt.
Diffstat (limited to 'src/level_gen/util.rs')
-rw-r--r-- | src/level_gen/util.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/level_gen/util.rs b/src/level_gen/util.rs index 89a4a6a882da..629292c430fa 100644 --- a/src/level_gen/util.rs +++ b/src/level_gen/util.rs @@ -13,6 +13,8 @@ pub fn falses(dims: &Dimensions) -> Vec<Vec<bool>> { ret } +/// Randomly initialize a 2-dimensional boolean vector of the given +/// `Dimensions`, using the given random number generator and alive chance pub fn rand_initialize<R: Rng + ?Sized>( dims: &Dimensions, rng: &mut R, |