Method: Zyps::GameObject#initialize

Defined in:
lib/zyps.rb

#initialize(options = {}) ⇒ GameObject

Takes a hash with these keys and defaults: :name => nil, :location => Location.new, :color => Color.new, :vector => Vector.new, :age => 0, :size => 1, :tags => []



145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/zyps.rb', line 145

def initialize (options = {})
  options = {
    :name => nil,
    :location => Location.new,
    :color => Color.new,
    :vector => Vector.new,
    :age => 0,
    :size => 1,
    :tags => []
  }.merge(options)
  self.name, self.location, self.color, self.vector, self.age, self.size, self.tags = options[:name], options[:location], options[:color], options[:vector], options[:age], options[:size], options[:tags]
  @identifier = generate_identifier
end