forked from p34709852/monkey
Island: Add set_simulation_mode Island event handler
This commit is contained in:
parent
9ce652f1a5
commit
b4c1879bf9
|
@ -1,3 +1,4 @@
|
|||
from .reset_agent_configuration import reset_agent_configuration
|
||||
from .reset_machine_repository import reset_machine_repository
|
||||
from .set_agent_configuration_per_island_mode import set_agent_configuration_per_island_mode
|
||||
from .set_simulation_mode import set_simulation_mode
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
from typing import Any
|
||||
|
||||
from monkey_island.cc.repository import ISimulationRepository
|
||||
|
||||
|
||||
class set_simulation_mode:
|
||||
"""
|
||||
Callable class that sets the Island's mode
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
simulation_repository: ISimulationRepository,
|
||||
):
|
||||
self._simulation_repository = simulation_repository
|
||||
|
||||
def __call__(self, event: Any = None):
|
||||
mode = event
|
||||
self._simulation_repository.set_mode(mode)
|
Loading…
Reference in New Issue