Module: GameData::MiningGame

Defined in:
docs/4_Systems_801_Mining_Game.rb

Overview

Module that describes the Mining Game database and its derived methods

Constant Summary collapse

DATA_ITEM =

The data list of each item that exist for the MiningGame probability is an Integer and states how many chances out of the total of chances the item will be picked by the system. layout is a [Array<Array>] where each sub-Array is assigned to one line; x means a part of the ITEM is here, o means that’s not the case. accepted_max_rotation is an Integer (between 0 and 3) determining the max rotation the sprite can have (90x degrees, x being accepted_max_rotation).

{}
DATA_IRON =

The data list of each iron that exist for the MiningGame probability is an Integer and states how many chances out of the total of chances the item will be picked by the system. layout is a [Array<Array>] where each sub-Array is assigned to one line; x means a part of the ITEM is here, o means that’s not the case. accepted_max_rotation is an Integer (between 0 and 3) determining the max rotation the sprite can have (90x degrees, x being accepted_max_rotation).

{}

Class Method Summary collapse

Class Method Details

.iron_total_chanceInteger

Return the total of the chances to get a certain iron

Returns:

  • (Integer)


102
103
# File 'docs/4_Systems_801_Mining_Game.rb', line 102

def iron_total_chance
end

.o

Sign that indicate a part of the ITEM does not exist on a specific tile of a layout

Returns:

  • false



11
12
# File 'docs/4_Systems_801_Mining_Game.rb', line 11

def o
end

.register_iron(symbol, probability, layout, accepted_max_rotation)

Register an iron

Parameters:

  • symbol (Symbol)

    unique name of the iron

  • probability (Integer)

    chance of the iron to appear

  • layout (Array<Array<boolean>>)

    layout of the iron

  • accepted_max_rotation (Integer)

    ask Rey about it



25
26
# File 'docs/4_Systems_801_Mining_Game.rb', line 25

def register_iron(symbol, probability, layout, accepted_max_rotation)
end

.register_item(db_symbol, probability, layout, accepted_max_rotation)

Register an item

Parameters:

  • db_symbol (Symbol)

    db_symbol of the item

  • probability (Integer)

    chance of the item to appear

  • layout (Array<Array<boolean>>)

    layout of the item

  • accepted_max_rotation (Integer)

    ask Rey about it



18
19
# File 'docs/4_Systems_801_Mining_Game.rb', line 18

def register_item(db_symbol, probability, layout, accepted_max_rotation)
end

.total_chanceInteger

Return the total of the chances to get a certain item

Returns:

  • (Integer)


98
99
# File 'docs/4_Systems_801_Mining_Game.rb', line 98

def total_chance
end

.x

Sign that indicate a part of the ITEM exist on a specific tile of a layout

Returns:

  • true



7
8
# File 'docs/4_Systems_801_Mining_Game.rb', line 7

def x
end