Module mk2lib.const

Constants for Machi Koro 2 bot.

Classes

class ActivationOrder (*args, **kwds)
Expand source code
class ActivationOrder(StrEnum):
    """
    Activation order (that is, color) of Establishment card.
    """

    OTHER_TURN = "other_turn"
    ANY_TURN = "any_turn"
    OWN_TURN = "own_turn"
    OWN_TURN_MAJOR = "own_turn_major"

Activation order (that is, color) of Establishment card.

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var ANY_TURN

The type of the None singleton.

var OTHER_TURN

The type of the None singleton.

var OWN_TURN

The type of the None singleton.

var OWN_TURN_MAJOR

The type of the None singleton.

class Effect (*args, **kwds)
Expand source code
class Effect(StrEnum):
    """
    Orange landmark card effects.
    """

    SKIP_BUILD_FOR_5_COINS = auto()
    GET_8_COINS_ON_12_ROLL = auto()
    TAKE_2_COINS_ON_DOUBLE = auto()
    BOOST_ONE_COIN_SHOP = auto()
    BOOST_ONE_COIN_FOOD = auto()
    BOOST_ONE_COIN_GEAR = auto()
    BOOST_ONE_COIN_AGRICULTURE = auto()
    NO_EARN_COMPENSATION_ONE_DICE = auto()
    NO_EARN_COMPENSATION_TWO_DICE = auto()
    EXTRA_TURN_ON_DOUBLE = auto()
    GET_COIN_FOR_EACH_FOOD_IF_ROLLED_6 = auto()
    GIVE_ESTABLISHMENT_ON_DOUBLE = auto()
    LAUNCH_PAD_DISCOUNT = auto()

Orange landmark card effects.

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var BOOST_ONE_COIN_AGRICULTURE

The type of the None singleton.

var BOOST_ONE_COIN_FOOD

The type of the None singleton.

var BOOST_ONE_COIN_GEAR

The type of the None singleton.

var BOOST_ONE_COIN_SHOP

The type of the None singleton.

var EXTRA_TURN_ON_DOUBLE

The type of the None singleton.

var GET_8_COINS_ON_12_ROLL

The type of the None singleton.

var GET_COIN_FOR_EACH_FOOD_IF_ROLLED_6

The type of the None singleton.

var GIVE_ESTABLISHMENT_ON_DOUBLE

The type of the None singleton.

var LAUNCH_PAD_DISCOUNT

The type of the None singleton.

var NO_EARN_COMPENSATION_ONE_DICE

The type of the None singleton.

var NO_EARN_COMPENSATION_TWO_DICE

The type of the None singleton.

var SKIP_BUILD_FOR_5_COINS

The type of the None singleton.

var TAKE_2_COINS_ON_DOUBLE

The type of the None singleton.

class GameState (*args, **kwds)
Expand source code
class GameState(IntEnum):
    """
    Enum of game states for state machine.
    """

    NOT_STARTED = auto()
    ON_ROLL = auto()
    ON_BUILD = auto()
    ON_ESTABLISHMENT_EXCHANGE = auto()
    ON_ESTABLISHMENT_GIVE = auto()
    TURN_FINISHED = auto()
    FINISHED = auto()
    CANCELLED = auto()

    @property
    def is_game_active(self) -> bool:
        """
        Check that game is not in lobby and isn't closed.

        :return: Whether game is in progress.
        """
        if self in (GameState.NOT_STARTED, GameState.FINISHED, GameState.CANCELLED):
            return False
        return True

    @property
    def is_game_ended(self) -> bool:
        """
        Check that game is not finished.

        :return: Whether game is in lobby or in progress.
        """
        if self in (GameState.FINISHED, GameState.CANCELLED):
            return True
        return False

    @property
    def is_in_lobby(self) -> bool:
        """
        Check that game is not in progress and not finished/cancelled.

        :return: Whether game is in lobby.
        """
        if self == GameState.NOT_STARTED:
            return True
        return False

Enum of game states for state machine.

Ancestors

  • enum.IntEnum
  • builtins.int
  • enum.ReprEnum
  • enum.Enum

Class variables

var CANCELLED

The type of the None singleton.

var FINISHED

The type of the None singleton.

var NOT_STARTED

The type of the None singleton.

var ON_BUILD

The type of the None singleton.

var ON_ESTABLISHMENT_EXCHANGE

The type of the None singleton.

var ON_ESTABLISHMENT_GIVE

The type of the None singleton.

var ON_ROLL

The type of the None singleton.

var TURN_FINISHED

The type of the None singleton.

Instance variables

prop is_game_active : bool
Expand source code
@property
def is_game_active(self) -> bool:
    """
    Check that game is not in lobby and isn't closed.

    :return: Whether game is in progress.
    """
    if self in (GameState.NOT_STARTED, GameState.FINISHED, GameState.CANCELLED):
        return False
    return True

Check that game is not in lobby and isn't closed.

:return: Whether game is in progress.

prop is_game_ended : bool
Expand source code
@property
def is_game_ended(self) -> bool:
    """
    Check that game is not finished.

    :return: Whether game is in lobby or in progress.
    """
    if self in (GameState.FINISHED, GameState.CANCELLED):
        return True
    return False

Check that game is not finished.

:return: Whether game is in lobby or in progress.

prop is_in_lobby : bool
Expand source code
@property
def is_in_lobby(self) -> bool:
    """
    Check that game is not in progress and not finished/cancelled.

    :return: Whether game is in lobby.
    """
    if self == GameState.NOT_STARTED:
        return True
    return False

Check that game is not in progress and not finished/cancelled.

:return: Whether game is in lobby.

class Kind (*args, **kwds)
Expand source code
class Kind(StrEnum):
    """
    Category (symbol) of Establishment card.
    """

    FOOD = "food"
    SHOP = "shop"
    GEAR = "gear"
    AGRICULTURE = "agriculture"
    FLOWER = "flower"
    FRUIT = "fruit"
    MAJOR = "major"
    COMBO = "combo"

Category (symbol) of Establishment card.

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var AGRICULTURE

The type of the None singleton.

var COMBO

The type of the None singleton.

var FLOWER

The type of the None singleton.

var FOOD

The type of the None singleton.

var FRUIT

The type of the None singleton.

var GEAR

The type of the None singleton.

var MAJOR

The type of the None singleton.

var SHOP

The type of the None singleton.

class LandmarkKind (*args, **kwds)
Expand source code
class LandmarkKind(StrEnum):
    """
    Landmark card kind (color).
    """

    ANY_TURN_INFINITE = "any_turn_infinite"
    OWN_TURN_ONCE = "own_turn_once"
    OWN_TURN_INFINITE = "own_turn_infinite"
    OWN_TURN_INSTAWIN = "own_turn_instawin"

Landmark card kind (color).

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var ANY_TURN_INFINITE

The type of the None singleton.

var OWN_TURN_INFINITE

The type of the None singleton.

var OWN_TURN_INSTAWIN

The type of the None singleton.

var OWN_TURN_ONCE

The type of the None singleton.