Added new cli parser
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
class Config:
|
||||
def __init__(self) -> None:
|
||||
with open("config.json", encoding="utf-8") as jsonFile:
|
||||
def __init__(self, configName = "config") -> None:
|
||||
with open(configName + ".json", encoding="utf-8") as jsonFile:
|
||||
self.file = json.load(jsonFile)
|
||||
+2
-2
@@ -7,8 +7,8 @@ from bots.idling.IdlingAgent import IdlingAgent
|
||||
from core.Player import Player, PLAYER_STATE
|
||||
|
||||
class MainAgent:
|
||||
def __init__(self) -> None:
|
||||
self.config = Config()
|
||||
def __init__(self, configName = "config ") -> None:
|
||||
self.config = Config(configName)
|
||||
self.monitor = Monitor(self.config)
|
||||
self.playerAgent = Player(self.monitor, self.config)
|
||||
self.idlingBot = IdlingAgent(self.monitor, self.playerAgent)
|
||||
|
||||
@@ -5,7 +5,8 @@ class CLIAgent:
|
||||
def __init__(self, mainAgent) -> None:
|
||||
self.isRunning = False
|
||||
self.logger = Logger("CliAgent")
|
||||
if (not mainAgent):
|
||||
|
||||
if (not mainAgent):
|
||||
raise Exception("Main agent not found...")
|
||||
self.mainAgent = mainAgent
|
||||
|
||||
|
||||
Reference in New Issue
Block a user