Ejemplo n.º 1
0
    def read(self) -> None:
        if any(
            not path.exists()
            for path in (self.pmc_profile_path, self.scav_profile_path)
        ):
            raise Profile.ProfileDoesNotExistsError

        self.pmc = ProfileModel.parse_file(self.pmc_profile_path)
        self.scav = ProfileModel.parse_file(self.scav_profile_path)

        self.encyclopedia = self.__encyclopedia_factory(profile=self)
        self.inventory = PlayerInventory(profile=self)
        self.inventory.read()

        self.quests = self.__quests_factory(profile=self)

        self.hideout = self.__hideout_factory(profile=self)
        self.hideout.read()

        self.mail = Mail(profile=self, notifier_service=self.__notifier_service)
        self.mail.read()
Ejemplo n.º 2
0
    def read(
        self,
        notifier_service: NotifierService = Provide[
            AppContainer.notifier.service]
    ) -> None:
        if any(not path.exists()
               for path in (self.pmc_profile_path, self.scav_profile_path)):
            raise Profile.ProfileDoesNotExistsError

        self.pmc = ProfileModel.parse_file(self.pmc_profile_path)
        self.scav = ProfileModel.parse_file(self.scav_profile_path)

        self.encyclopedia = Encyclopedia(profile=self)
        self.inventory = PlayerInventory(profile=self)
        self.inventory.read()

        self.quests = Quests(profile=self)

        self.hideout = Hideout(profile=self)
        self.hideout.read()

        self.mail = Mail(self, notifier_service)
        self.mail.read()
Ejemplo n.º 3
0
 def _make_inventory(inventory_path: str) -> PlayerInventory:
     target_inventory = InventoryModel.parse_file(inventory_path)
     with patch.object(player_profile.pmc, "Inventory", target_inventory):
         inventory = PlayerInventory(player_profile)
         inventory.read()
     return inventory
Ejemplo n.º 4
0
def inventory(player_profile: Profile) -> PlayerInventory:
    inventory = PlayerInventory(player_profile)
    inventory.read()
    return inventory