Class: PFM::MiningGame::Diggable

Inherits:
Object
  • Object
show all
Defined in:
docs/01450_Systems_08001_Mining_Game.rb

Overview

Class handling the property of a diggable element

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Diggable

Returns a new instance of Diggable.



327
328
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 327

def initialize(hash)
end

Instance Attribute Details

#accepted_rotationInteger

The accepted rotation of the diggable

Returns:

  • (Integer)


314
315
316
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 314

def accepted_rotation
  @accepted_rotation
end

#heightInteger

The height of the diggable

Returns:

  • (Integer)


302
303
304
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 302

def height
  @height
end

#is_an_itemBoolean

If the diggable is an item or not (then it’s an iron)

Returns:

  • (Boolean)


320
321
322
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 320

def is_an_item
  @is_an_item
end

#origin_patternArray<Array<Boolean>>

The original pattern of the diggable

Returns:

  • (Array<Array<Boolean>>)


308
309
310
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 308

def origin_pattern
  @origin_pattern
end

#patternArray<Array<Boolean>>

The current pattern of the diggable

Returns:

  • (Array<Array<Boolean>>)


311
312
313
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 311

def pattern
  @pattern
end

#placedBoolean

If the diggable is placed or not

Returns:

  • (Boolean)


323
324
325
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 323

def placed
  @placed
end

#revealedBoolean

If the diggable is revealed

Returns:

  • (Boolean)


326
327
328
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 326

def revealed
  @revealed
end

#rotationInteger

The current rotation of the diggable

Returns:

  • (Integer)


317
318
319
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 317

def rotation
  @rotation
end

#symbolSymbol

The symbol of the item the Diggable represent

Returns:

  • (Symbol)


305
306
307
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 305

def symbol
  @symbol
end

#widthInteger

The width of the diggable

Returns:

  • (Integer)


299
300
301
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 299

def width
  @width
end

#xInteger

The x position of the diggable

Returns:

  • (Integer)


293
294
295
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 293

def x
  @x
end

#yInteger

The y position of the diggable

Returns:

  • (Integer)


296
297
298
# File 'docs/01450_Systems_08001_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/01450_Systems_08001_Mining_Game.rb', line 342

def area_size
end

#overlap?(diggable) ⇒ Boolean

Test if another diggable is overlapping this diggable

Parameters:

Returns:

  • (Boolean)


339
340
# File 'docs/01450_Systems_08001_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/01450_Systems_08001_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

Parameters:

  • rotation (Integer)


334
335
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 334

def set_specific_rotation(rotation)
end