Module realm_bot.roll.dataclasses

Data classes for dice roller

Classes

class BatchRoll (*args, **kwargs)
Expand source code
class BatchRoll(list[list[RollSegment]]):
    pass

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

Ancestors

  • builtins.list
class ConstantModifier (raw: str, negative: bool = False, number: int = 0)
Expand source code
@dataclass
class ConstantModifier(RollSegment):
    number: int = 0

ConstantModifier(raw: str, negative: bool = False, number: int = 0)

Ancestors

Class variables

var number : int
class DiceRoll (raw: str,
negative: bool = False,
dice: int = 0,
faces: int = 0,
extra: str | None = None)
Expand source code
@dataclass
class DiceRoll(RollSegment):
    dice: int = 0
    faces: int = 0
    extra: str | None = None

DiceRoll(raw: str, negative: bool = False, dice: int = 0, faces: int = 0, extra: str | None = None)

Ancestors

Class variables

var dice : int
var extra : str | None
var faces : int
class RollSegment (raw: str, negative: bool = False)
Expand source code
@dataclass
class RollSegment:
    raw: str
    negative: bool = False

RollSegment(raw: str, negative: bool = False)

Subclasses

Class variables

var negative : bool
var raw : str
class SegmentResult (segment: RollSegment,
rolls: list[int] | None = None,
work: str | None = None,
total: int = 0)
Expand source code
@dataclass
class SegmentResult:
    segment: RollSegment
    rolls: list[int] | None = None
    work: str | None = None
    total: int = 0

SegmentResult(segment: realm_bot.roll.dataclasses.RollSegment, rolls: list[int] | None = None, work: str | None = None, total: int = 0)

Class variables

var rolls : list[int] | None
var segmentRollSegment
var total : int
var work : str | None