Class: PFM::MiningGame::Diggable
- Defined in:
- docs/4_Systems_801_Mining_Game.rb
Overview
Class handling the property of a diggable element
Instance Attribute Summary collapse
-
#accepted_rotation ⇒ Integer
The accepted rotation of the diggable.
-
#height ⇒ Integer
The height of the diggable.
-
#is_an_item ⇒ Boolean
If the diggable is an item or not (then it’s an iron).
-
#origin_pattern ⇒ Array<Array<Boolean>>
The original pattern of the diggable.
-
#pattern ⇒ Array<Array<Boolean>>
The current pattern of the diggable.
-
#placed ⇒ Boolean
If the diggable is placed or not.
-
#revealed ⇒ Boolean
If the diggable is revealed.
-
#rotation ⇒ Integer
The current rotation of the diggable.
-
#symbol ⇒ Symbol
The symbol of the item the Diggable represent.
-
#width ⇒ Integer
The width of the diggable.
-
#x ⇒ Integer
The x position of the diggable.
-
#y ⇒ Integer
The y position of the diggable.
Instance Method Summary collapse
-
#area_size
Give the area size (for sorting purpose).
-
#initialize(hash) ⇒ Diggable
constructor
A new instance of Diggable.
-
#overlap?(diggable) ⇒ Boolean
Test if another diggable is overlapping this diggable.
-
#set_new_rotation
Set a new rotation to the diggable and change values accordingly.
-
#set_specific_rotation(rotation)
Set a specific rotation to the diggable and change values accordingly.
Constructor Details
#initialize(hash) ⇒ Diggable
Returns a new instance of Diggable.
327 328 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 327 def initialize(hash) end |
Instance Attribute Details
#accepted_rotation ⇒ Integer
The accepted rotation of the diggable
314 315 316 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 314 def accepted_rotation @accepted_rotation end |
#height ⇒ Integer
The height of the diggable
302 303 304 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 302 def height @height end |
#is_an_item ⇒ Boolean
If the diggable is an item or not (then it’s an iron)
320 321 322 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 320 def is_an_item @is_an_item end |
#origin_pattern ⇒ Array<Array<Boolean>>
The original pattern of the diggable
308 309 310 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 308 def origin_pattern @origin_pattern end |
#pattern ⇒ Array<Array<Boolean>>
The current pattern of the diggable
311 312 313 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 311 def pattern @pattern end |
#placed ⇒ Boolean
If the diggable is placed or not
323 324 325 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 323 def placed @placed end |
#revealed ⇒ Boolean
If the diggable is revealed
326 327 328 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 326 def revealed @revealed end |
#rotation ⇒ Integer
The current rotation of the diggable
317 318 319 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 317 def rotation @rotation end |
#symbol ⇒ Symbol
The symbol of the item the Diggable represent
305 306 307 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 305 def symbol @symbol end |
#width ⇒ Integer
The width of the diggable
299 300 301 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 299 def width @width end |
#x ⇒ Integer
The x position of the diggable
293 294 295 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 293 def x @x end |
#y ⇒ Integer
The y position of the diggable
296 297 298 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 296 def y @y end |
Instance Method Details
#area_size
Give the area size (for sorting purpose)
342 343 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 342 def area_size end |
#overlap?(diggable) ⇒ Boolean
Test if another diggable is overlapping this diggable
339 340 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 339 def overlap?(diggable) end |
#set_new_rotation
Set a new rotation to the diggable and change values accordingly
330 331 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 330 def set_new_rotation end |
#set_specific_rotation(rotation)
Set a specific rotation to the diggable and change values accordingly
334 335 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 334 def set_specific_rotation(rotation) end |