lib/gamefic/action.rb in gamefic-0.0.3 vs lib/gamefic/action.rb in gamefic-0.0.4
- old
+ new
@@ -1,10 +1,13 @@
module Gamefic
class Action
- attr_reader :command
+ attr_reader :command, :order_key
@@defaults = Array.new
+ @@order_key_seed = 0
def initialize(story, command, *queries, &proc)
+ @order_key = @@order_key_seed
+ @@order_key_seed += 1
if (command.kind_of?(Symbol) == false)
raise "Action commands must be symbols"
end
if (queries.length + 1 != proc.arity) and (queries.length == 0 and proc.arity != -1)
raise "Number of contexts is not compatible with proc arguments"