This module contains PurePlay.

Module Contents



A stateless play that uses the same tactics for the entire lifetime.

class, ctx:

Bases:[PurePlay.Prop], abc.ABC

A stateless play that uses the same tactics for the entire lifetime.

class Prop
tactic_props: Dict[Type[stp.tactic.ITactic], Any]
__slots__ = ['_role_assignment', 'tactics']
_role_assignment: stp.role.assignment.IRoleAssignment
compute_props(prev_props: Prop | None) Prop
tick(world_state: stp.rc.WorldState, prev_results: stp.role.assignment.FlatRoleResults, props: Prop) Tuple[stp.role.assignment.FlatRoleResults, List[stp.action.IAction]]

Performs one “tick” of the specified play.

This should:
  1. Collect all the role requests from the tactics

  2. Perform role assignment

  3. Gives each tactic its assigned roles and getting a list of skills.

  4. Return the list of skills obtained.

  • world_state – The current state of the world.

  • prev_results – The previous results of role assignment.

  • props – Props from compute_props. This should be “const”, as all

mutations should happen in compute_props. :return: The list of skill to run.

collect_role_requests(world_state: stp.rc.WorldState)

Collects the role requests from each tactic. :param world_state: The current WorldState. :return: The collected play.RoleRequests.

get_actions_from_tactics(flat_results: stp.role.assignment.FlatRoleResults, prop: Prop) List[stp.action.IAction]

Passes the roles assigned from role assignment to the correct tactic. :param flat_results: The results of role assignment. :param prop: The props of the play. This should be “const”. :return: The list of skills for each tactic.