Skip to content

CombatChain

Bases: UserList

Represents a FaB combat chain for a particular turn.

Note

This is ultimately a superclass of list, and thus supports all common list methods.

Attributes:

Name Type Description
data list[ChainLink]

The raw list of ChainLink objects contained within the object.

Source code in fab/chain.py
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
class CombatChain(UserList):
    '''
    Represents a FaB combat chain for a particular turn.

    Note:
      This is ultimately a superclass of `list`, and thus supports all common
      `list` methods.

    Attributes:
      data: The raw `list` of `ChainLink` objects contained within the object.
    '''
    data: list[ChainLink]

    def current_link(self) -> ChainLink:
        '''
        Gets the current link of the combat chain.

        Returns:
          A mutable reference to the current link of the combat chain.
        '''
        return self.data[-1]

    @staticmethod
    def empty() -> CombatChain:
        '''
        Creates a new empty combat chain.

        Returns:
          A new empty `CombatChain` object.
        '''
        return CombatChain([])

Gets the current link of the combat chain.

Returns:

Type Description
ChainLink

A mutable reference to the current link of the combat chain.

Source code in fab/chain.py
77
78
79
80
81
82
83
84
def current_link(self) -> ChainLink:
    '''
    Gets the current link of the combat chain.

    Returns:
      A mutable reference to the current link of the combat chain.
    '''
    return self.data[-1]

empty() staticmethod

Creates a new empty combat chain.

Returns:

Type Description
CombatChain

A new empty CombatChain object.

Source code in fab/chain.py
86
87
88
89
90
91
92
93
94
@staticmethod
def empty() -> CombatChain:
    '''
    Creates a new empty combat chain.

    Returns:
      A new empty `CombatChain` object.
    '''
    return CombatChain([])