Encoding Plan
from dgisim import EncodingPlan
EncodingPlan is a class defining how to encode a game.
- class EncodingPlan(mode_mapping: dict[type['Mode'], int], card_mapping: dict[type['Card'], int], enum_mapping: dict[enum.Enum, int], char_mapping: dict[type['Character'], int], effect_mapping: dict[type['Effect'], int], status_mapping: dict[type['Status'], int], summon_mapping: dict[type['Summon'], int], support_mapping: dict[type['Support'], int], phase_base: int = 450, cards_fixed_len: int = 50, dice_fixed_len: int = 20, status_fixed_len: int = 7, statuses_fixed_len: int = 10, char_hidden_fixed_len: int = 4, char_stt_fixed_len: int = 13, player_hidden_fixed_len: int = 10, player_combat_fixed_len: int = 10, summons_fixed_len: int = 4, supports_fixed_len: int = 4, effect_fixed_len: int = 25, effects_fixed_len: int = 40, perspective: Pid = Pid.P1)
- __init__(mode_mapping: dict[type['Mode'], int], card_mapping: dict[type['Card'], int], enum_mapping: dict[enum.Enum, int], char_mapping: dict[type['Character'], int], effect_mapping: dict[type['Effect'], int], status_mapping: dict[type['Status'], int], summon_mapping: dict[type['Summon'], int], support_mapping: dict[type['Support'], int], phase_base: int = 450, cards_fixed_len: int = 50, dice_fixed_len: int = 20, status_fixed_len: int = 7, statuses_fixed_len: int = 10, char_hidden_fixed_len: int = 4, char_stt_fixed_len: int = 13, player_hidden_fixed_len: int = 10, player_combat_fixed_len: int = 10, summons_fixed_len: int = 4, supports_fixed_len: int = 4, effect_fixed_len: int = 25, effects_fixed_len: int = 40, perspective: Pid = Pid.P1) None
- Parameters:
mode_mapping – a mapping from mode to code.
card_mapping – a mapping from card to code.
char_mapping – a mapping from character to code.
effect_mapping – a mapping from effect to code.
status_mapping – a mapping from status to code.
summon_mapping – a mapping from summon to code.
support_mapping – a mapping from support to code.
cards_fixed_len – the fixed length of any encoded cards vector.
status_fixed_len – the default fixed length of encoded status vector.
statuses_fixed_len – the default fixed length of encoded statuses vector.
char_hidden_fixed_len – the default fixed length of encoded character hidden statuses vector.
char_stt_fixed_len – the default fixed length of encoded character statuses vector.
player_hidden_fixed_len – the default fixed length of encoded player hidden statuses vector.
player_combat_fixed_len – the default fixed length of encoded player combat statuses vector.
summons_fixed_len – the default fixed length of encoded summons vector.
supports_fixed_len – the default fixed length of encoded supports vector.
effect_fixed_len – the default fixed length of encoded effect vector.
effects_fixed_len – the default fixed length of encoded effects vector.
- compatible_with(mode: Mode) bool
- Returns:
True if this encoding plan is compatible with the given mode.
Note: currently only cards and characters are checked, all statuses are not.
LazyEncodingPlan is a subclass of EncodingPlan whose encode would always return an empty list.