Sha256: 41e5e1d46d1d0fcdbdc8e42dcf82b99d99de0438046b0a079dd0d4280ff55068
Contents?: true
Size: 857 Bytes
Versions: 2
Compression:
Stored size: 857 Bytes
Contents
module Monotony # Represents any landable square on the board. class Square attr_accessor :action, :name, :owner, :colour # @return [Symbol] Returns the name of the set containing this property. attr_accessor :set # @param [Hash] opts # @option opts [Symbol] :set a symbol identifying this property as a member of a set of properties. # @option opts [String] :name the name of the property. # @option opts [Proc] :action a procedure to run when a player lands on this square. # @option opts [Symbol] :colour the colour to use when rendering this square on a GUI. def initialize(opts) @owner = nil @set = opts[:set] || nil @name = opts[:name] @action = opts[:action] || Proc.new {|game, owner, player, property|} @colour = opts[:colour] || ( String.colors.include? opts[:set] ? opts[:set] : :light_black ) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
monotony-0.0.2 | lib/monotony/square.rb |
monotony-0.0.1 | lib/monotony/square.rb |