From 1638f40eccc4a1321ee1bf19e3756157b6c965e1 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Mon, 2 Sep 2024 00:21:13 +0200 Subject: refactored code, use get_ship dependency for ship related calls --- entities/agent.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 entities/agent.py (limited to 'entities/agent.py') diff --git a/entities/agent.py b/entities/agent.py new file mode 100644 index 0000000..ba99dac --- /dev/null +++ b/entities/agent.py @@ -0,0 +1,17 @@ +import openapi_client +from typing import Dict + +from .ship import Ship + + +class Agent: + def __init__(self, agent_symbol, token): + config = openapi_client.Configuration(access_token=token) + self.api_client = openapi_client.ApiClient(config) + + self.agents_api = openapi_client.AgentsApi(self.api_client) + self.fleet_api = openapi_client.FleetApi(self.api_client) + self.systems_api = openapi_client.SystemsApi(self.api_client) + + self.agent_symbol = agent_symbol + self.ships: Dict[str, Ship] = {} -- cgit v1.2.3-70-g09d2