command module
Define the base class from which all commands will inherit.
- class Command(line: list[str], dat_idx: int, **kwargs)
Bases:
InstructionA generic Command class.
- Parameters:
- set_influenced_elements(instructions: list[Instruction], **kwargs: float) None
Determine the index of the elements concerned by
apply().
- abstract apply(instructions: list[Instruction], **kwargs: float) list[Instruction]
Apply the command.
- concerns_one_of(dat_indexes: Iterable[int]) bool
Tell if
selfconcerns an element, whichdat_idxis given.Internally, we convert the
self.influencedfrom asetto alistobject and check intersections withdat_indexes.
- _indexes_between_this_command_and(instructions_after_self: Sequence[Instruction], *stop_types: type) slice
Determine the indexes of the instructions affected by an instruction.
We return the indexes of instructions between the first of
instructionsand the first instruction which type is instop_types.- Parameters:
instructions_after_self (Sequence[Instruction]) – All instructions after
self(selfnot included).stop_types (type) – Type(s) of commands after which
selfhas no influence. If not provided, we set it to the type ofself. In other words, aFREQinfluences every element up to the followingFREQ.
- Returns:
All the indexes of the instrutions that will be affected by self.
- Return type:
- increment_dat_position(increment: int = 1) None
Increment dat_index and indexes of elements concerned by command.
- _abc_impl = <_abc._abc_data object at 0x7fd3ce6dc240>