Bläddra i källkod

Added get_seed function to AttackController

Stefan Schmidt 6 år sedan
förälder
incheckning
06802ea711
1 ändrade filer med 9 tillägg och 1 borttagningar
  1. 9 1
      code/Core/AttackController.py

+ 9 - 1
code/Core/AttackController.py

@@ -2,6 +2,7 @@ import importlib
 import sys
 import difflib
 import pkgutil
+import typing
 
 import Attack.AttackParameters as atkParam
 import Core.LabelManager as LabelManager
@@ -29,7 +30,7 @@ class AttackController:
         self.seed = None
         self.total_packets = 0
 
-    def set_seed(self, seed: int):
+    def set_seed(self, seed: int) -> None:
         """
         Sets rng seed.
 
@@ -37,6 +38,13 @@ class AttackController:
         """
         self.seed = seed
 
+    def get_seed(self) -> typing.Union[int, None]:
+        """
+        Gets rng seed.
+        :return: The current rng seed
+        """
+        return self.seed
+
     @staticmethod
     def choose_attack(input_name):
         """"