gachapy.loader

Library of loader functions for loading gachapy objects from json files. These functions can be used to save and load Controller objects to and from json files. This should be used to save and load game state of active gachapy games. Loading and saving objects lower than the Controller (Items, Banners, Players) separately is not supported.

Examples of the structure that gachapy json files should follow can be found in the examples/ directory

These functions operate as the Loader of a gachapy game

Author: Jacob Kerr, 2021

gachapy.loader.load_controller(filename: str) Controller[source]

Creates a Controller object from the specified json files

Parameters

filenamestr

the path of the json file

Returns

Controller

the controller loaded from the specified files

gachapy.loader.save_controller(controller: Controller, filename: str) None[source]

Saves the controller in json format into the specified files

Parameters

controllerController

the controller to save into files

filenamestr

the path to the json file

Returns

None