Skip to content

Commit

Permalink
Merge pull request #1 from verachell/dev
Browse files Browse the repository at this point in the history
feat: add user ability to assign lists from catalog subsets
  • Loading branch information
verachell authored Nov 1, 2021
2 parents be6f658 + 18d8072 commit b0089fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions yeetwords.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,13 @@ def assign_parse(style, curr_state, cmdhash)
if possible_value[:unit_type] == style then
# the types match; proceed with selection
rvalue = select_random_unique.call(howmany, possible_value[:value])
### begin changes for v1.1.0 ###
# next allow for list assignment from catalog
elsif (style == :list) and (possible_value[:unit_type] == :catalog) then
rvalue = Array.new
catitems = select_random_unique.call(howmany, possible_value[:value])
catitems.each_value{|value| rvalue = rvalue + value}
### end changes for v1.1.0 ###
else
# ERR_ID CARROT
stop_with_general_command_error("The name of your command does not match the type of your variable #{rsplit[0]}", command, cmdhash[:linenum], cmdhash[:comline])
Expand Down

0 comments on commit b0089fa

Please sign in to comment.