GridElement module

class GridElement.GridElement(width, height, in_out_positions)[source]

Bases: object

Abstract class that implements shared behaviours between elements that are grid based

Parameters:
  • width (Int) – Width of the blueprint

  • height (Int) – Height of the blueprint

  • in_out_positions (Dictionary) – Contains the input and output positions and type of item carrying

input_item(x, y)[source]

Returns the input item at the position (x,y)

Parameters:
  • x (Int) – row coordinate

  • y (Int) – column coordinate

Returns:

the name of the item that the input cell at (x,y) is carrying

Return type:

String

input_rate(x, y)[source]

Returns the rate of the item at the position (x,y)

Parameters:
  • x (Int) – row coordinate

  • y (Int) – column coordinate

Returns:

number of items per minute of the input cell (x,y)

Return type:

Int

is_input(x, y)[source]

Returns if a postition in the blueprint is an input

Parameters:
  • x (Int) – row coordinate

  • y (Int) – column coordinate

Returns:

a boolean that is true if the (x,y) pos is an actual input

Return type:

Bool

is_output(x, y)[source]

Returns if a postition in the blueprint is an output

Parameters:
  • x (Int) – row coordinate

  • y (Int) – column coordinate

Returns:

a boolean that is true if the (x,y) pos is an actual output

Return type:

Bool

output_item(x, y)[source]

Returns the output item at the position (x,y)

Parameters:
  • x (Int) – row coordinate

  • y (Int) – column coordinate

Returns:

the name of the item that the output cell at (x,y) is carrying

Return type:

String