-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from XVs32/85-record-the-equipment-of-every-ship
85 record the equipment of every ship
- Loading branch information
Showing
4 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from util.json_data import JsonData | ||
from util.logger import Log | ||
from util.wctf import WhoCallsTheFleetData | ||
|
||
class EquipmentCore(object): | ||
|
||
equipment = {} | ||
|
||
def __init__(self): | ||
self.equipment["loaded"] = {} | ||
self.equipment["free"] = {} | ||
|
||
def get_loaded_equipment(self, api_data): | ||
""" | ||
method to read the loaded equipment list from api data | ||
api_data (dict) : data from "port/api_data/api_ship" api | ||
""" | ||
self.equipment["loaded"] = {} | ||
|
||
for ship in api_data: | ||
Log.log_debug(f"ship {ship['api_id']} equipment") | ||
Log.log_debug(ship["api_slot"]) | ||
Log.log_debug(ship["api_slot_ex"]) | ||
self.equipment["loaded"][ship['api_id']] = ship["api_slot"] | ||
self.equipment["loaded"][ship['api_id']].append(ship["api_slot_ex"]) | ||
Log.log_debug(self.equipment["loaded"]) | ||
|
||
equipment = EquipmentCore() |