Class: RubyCraft::BlockColor

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycraft/block_type.rb

Constant Summary collapse

InvertedColor =

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, r, g, b, data) ⇒ BlockColor

Returns a new instance of BlockColor.



135
136
137
138
139
140
141
# File 'lib/rubycraft/block_type.rb', line 135

def initialize(name, r, g, b, data)
  @name = name
  @r = r
  @g = g
  @b = b
  @data = data
end

Instance Attribute Details

#bObject (readonly)

Returns the value of attribute b.



134
135
136
# File 'lib/rubycraft/block_type.rb', line 134

def b
  @b
end

#dataObject (readonly)

Returns the value of attribute data.



134
135
136
# File 'lib/rubycraft/block_type.rb', line 134

def data
  @data
end

#gObject (readonly)

Returns the value of attribute g.



134
135
136
# File 'lib/rubycraft/block_type.rb', line 134

def g
  @g
end

#nameObject (readonly)

Returns the value of attribute name.



134
135
136
# File 'lib/rubycraft/block_type.rb', line 134

def name
  @name
end

#rObject (readonly)

Returns the value of attribute r.



134
135
136
# File 'lib/rubycraft/block_type.rb', line 134

def r
  @r
end

Class Method Details

.method_missing(name, *args) ⇒ Object



125
126
127
128
# File 'lib/rubycraft/block_type.rb', line 125

def self.method_missing(name, *args)
  args << @typeColor.size
  @typeColor << new(name, *args)
end

.typeColorObject



130
131
132
# File 'lib/rubycraft/block_type.rb', line 130

def self.typeColor
  @typeColor
end

Instance Method Details

#rgbObject



143
144
145
# File 'lib/rubycraft/block_type.rb', line 143

def rgb
  [r, g, b]
end