Tiles

class src.tiles.Desert[source]

Derived Class from Tile abstract class

generate_resource()[source]

Displays which new resource has now been generated

Returns:

1 new resource based on which tile is in use

Return type:

Resource

name()[source]

Displays a string indicating the Name of the Tile - Desert

Returns:

A string displaying the tile name

Return type:

str

short_name()[source]

Displays a string indicating the short Name of the tile - de

Returns:

A string displaying the short tile name

Return type:

str

class src.tiles.Fields[source]

Derived Class from Tile abstract class

generate_resource()[source]

Displays which new resource has now been generated

Returns:

1 new resource based on which tile is in use

Return type:

Resource

name()[source]

Displays a string indicating the Name of the Tile - Fields

Returns:

A string displaying the tile name

Return type:

str

short_name()[source]

Displays a string indicating the short Name of the tile - fi

Returns:

A string displaying the short tile name

Return type:

str

class src.tiles.Forest[source]

Derived Class from Tile abstract class

generate_resource()[source]

Displays which new resource has now been generated

Returns:

1 new resource based on which tile is in use

Return type:

Resource

name()[source]

Displays a string indicating the Name of the Tile - Forest

Returns:

A string displaying the tile name

Return type:

str

short_name()[source]

Displays a string indicating the short Name of the tile - Fo

Returns:

A string displaying the short tile name

Return type:

str

class src.tiles.GameTile(real_number, tile, points, tile_id)[source]

Represents a game tile in a hexagonal grid, with associated coordinates and edges.

Parameters:
  • real_number (int) – The number that will show on the GUI.

  • tile (object) – The tile object.

  • points (int) – The points of the tile.

  • tile_id (int) – The unique ID of the tile.

This class represents a game tile in a hexagonal grid. It contains attributes that represent the tile’s real number, the tile object, its points, and its unique ID. It also has properties that represent its coordinates and edges, which are calculated using the Hexgrid module.

get_tile_info()[source]

Returns a dictionary of the tile’s ID, coordinates, and edges.

Returns:

A dictionary of the tile’s ID, coordinates, and edges.

Return type:

dict

class src.tiles.Hills[source]

Derived Class from Tile abstract class

generate_resource()[source]

Displays which new resource has now been generated

Returns:

1 new resource based on which tile is in use

Return type:

Resource

name()[source]

Displays a string indicating the Name of the Tile - Hills

Returns:

A string displaying the tile name

Return type:

str

short_name()[source]

Displays a string indicating the short Name of the tile - hi

Returns:

A string displaying the short tile name

Return type:

str

class src.tiles.Mountain[source]

Derived Class from Tile abstract class

generate_resource()[source]

Displays which new resource has now been generated

Returns:

1 new resource based on which tile is in use

Return type:

Resource

name()[source]

Displays a string indicating the Name of the Tile - Mountain

Returns:

A string displaying the tile name

Return type:

str

short_name()[source]

Displays a string indicating the short Name of the tile - mo

Returns:

A string displaying the short tile name

Return type:

str

class src.tiles.Pasture[source]

Derived Class from Tile abstract class

generate_resource()[source]

Displays which new resource has now been generated

Returns:

1 new resource based on which tile is in use

Return type:

Resource

name()[source]

Displays a string indicating the Name of the Tile - Pasture

Returns:

A string displaying the tile name

Return type:

str

short_name()[source]

Displays a string indicating the short Name of the tile - Pa

Returns:

A string displaying the short tile name

Return type:

str

class src.tiles.ResourceTile(value)[source]

Represents a resource tile in the game, with associated properties and methods.

This class is an enumeration of the different types of resource tiles in the game, including Forest, Pasture, Fields, Hills, Mountain, and Desert. Each type of tile has a corresponding Tile object, which is used to generate resources and provide other information.

asset()[source]

Returns the asset file associated with the resource tile.

Returns:

The asset file associated with the resource tile.

Return type:

str

generate_resource()[source]

Generates a resource for the resource tile.

Returns:

The generated resource.

Return type:

Resource

short_name()[source]

Returns the short name of the resource tile.

Returns:

The short name of the resource tile.

Return type:

str

class src.tiles.Tile[source]

Abstract class template for Tiles and controls behaviour for all tile card types, also inherits behaviour from abstract class so that the correct image files are retrieved for each tile

Parameters:

Abstract (type) – abstract base class in utils.py

asset()[source]

Returns Tile asset

Returns:

Tile asset file

Return type:

str

abstract generate_resource()[source]

Abstract method representing description of a game tile

Should be implemented by derived classes to return tile’s description

Returns:

1 new resource based on which tile is in use

abstract name()[source]

Abstract method representing description of a game tile

Should be implemented by derived classes to return tile’s description

Returns:

A String representing the description of a tile

abstract short_name()[source]

Abstract method representing short name description of a game tile

Should be implemented by derived classes to return short tile’s description

Returns:

A String representing the short name description of a tile