yawning_titan.db.compatibility_query#

Functions

check_element

Check that a restrict-able element is suitable for a given value.

Classes

yawning_titan.db.compatibility_query.check_element(el_dict, n, include_unbounded)[source]#

Check that a restrict-able element is suitable for a given value.

I.e the value lies in a given range.

Parameters:
  • el_dict – The dictionary representing of a ConfigGroup related to a range restricted element

  • n – The target value of a field as a Network.

  • include_unbounded – Whether to include fields where part of the range is unbounded.

Returns:

A boolean representing of the element is suited for a particular value.

class yawning_titan.db.compatibility_query.EntryNodeCompatibilityQuery[source]#

The YawningTitanQuery class extends tinydb.queries.Query.

Extended to provide common pre-defined test functions that call tinydb.queries.Query.test(), These functions are specific to the compatibility of :class: ~yawning_titan.game_modes.game_mode.GameMode and :class: ~yawning_titan.networks.network.Network objects.

works_with(n, include_unbounded=False)[source]#

Tests the game mode can work with a network with the parameter with a value of n.

Fields whose value is either unrestricted or where n is in the specified range are returned in the search.

Example:

>>> from yawning_titan.game_modes.game_mode_db import GameModeDB
>>> from yawning_titan.db.query import YawningTitanQuery
>>> db = GameModeDB()
>>> db.search(EntryNodeCompatibilityQuery.ENTRY_NODES.works_with(18)))
Parameters:
  • n – The target value of a field as an int or an instance of :class: ~yawning_titan.networks.network.Network.

  • include_unbounded – Whether to include fields where part of the range is unbounded.

Returns:

True if it does exist, otherwise False.

class yawning_titan.db.compatibility_query.HighValueNodeCompatibilityQuery[source]#

The YawningTitanQuery class extends tinydb.queries.Query.

Extended to provide common pre-defined test functions that call tinydb.queries.Query.test(), These functions are specific to the compatibility of :class: ~yawning_titan.game_modes.game_mode.GameMode and :class: ~yawning_titan.networks.network.Network objects.

works_with(n, include_unbounded=False)[source]#

Tests the game mode can work with a network with the parameter with a value of n.

Fields whose value is either unrestricted or where n is in the specified range are returned in the search.

Example:

>>> from yawning_titan.game_modes.game_mode_db import GameModeDB
>>> from yawning_titan.db.query import YawningTitanQuery
>>> db = GameModeDB()
>>> db.search(HighValueNodeCompatibilityQuery.HIGH_VALUE_NODES.works_with(18)))
Parameters:
  • n – The target value of a field as an int or an instance of :class: ~yawning_titan.networks.network.Network.

  • include_unbounded – Whether to include fields where part of the range is unbounded.

Returns:

True if it does exist, otherwise False.

class yawning_titan.db.compatibility_query.NetworkNodeCompatibilityQuery[source]#

The YawningTitanQuery class extends tinydb.queries.Query.

Extended to provide common pre-defined test functions that call tinydb.queries.Query.test(), These functions are specific to the compatibility of :class: ~yawning_titan.game_modes.game_mode.GameMode and :class: ~yawning_titan.networks.network.Network objects.

works_with(n, include_unbounded=False)[source]#

Tests the game mode can work with a network with the parameter with a value of n.

Fields whose value is either unrestricted or where n is in the specified range are returned in the search.

Example:

>>> from yawning_titan.game_modes.game_mode_db import GameModeDB
>>> from yawning_titan.db.query import YawningTitanQuery
>>> db = GameModeDB()
>>> db.search(NetworkNodeCompatibilityQuery.HIGH_VALUE_NODES.works_with(18)))
Parameters:
  • n – The target value of a field as an int or an instance of :class: ~yawning_titan.networks.network.Network.

  • include_unbounded – Whether to include fields where part of the range is unbounded.

Returns:

True if it does exist, otherwise False.

class yawning_titan.db.compatibility_query.NetworkCompatibilityQuery[source]#

The YawningTitanQuery class extends tinydb.queries.Query.

Extended to provide common pre-defined test functions that call tinydb.queries.Query.test(), These functions are specific to the compatibility of :class: ~yawning_titan.game_modes.game_mode.GameMode and :class: ~yawning_titan.networks.network.Network objects.

compatible_with(n, include_unbounded=True)[source]#

Tests the game mode can work with a specified network n.

Fields where all network parameter restrictions are satisfied or unrestricted are returned in the search.

Example:

>>> from yawning_titan.game_modes.game_mode_db import GameModeDB
>>> from yawning_titan.db.query import YawningTitanQuery
>>> db = GameModeDB()
>>> db.search(NetworkCompatibilityQuery.compatible_with(network)))
Parameters:
  • n – The target value of a field as an instance of :class: ~yawning_titan.networks.network.Network.

  • include_unbounded – Whether to include fields where part of the range is unbounded.

Returns:

True if it does exist, otherwise False.