示例#1
0
def load_from_json(filename):
    import json

    with open(filename) as json_file:
        print('')
        print('{} loaded.'.format(filename))
        print('')
        loaded_object = json.load(json_file)
        print('loaded_object', loaded_object)
        return sc.Ship(**loaded_object)
示例#2
0

master_component_dict = {
    'weapons': my_weapon_class_dict,
    'shields': scomp.my_component_class_dict['shields']
}

# create_ship()

ship_1 = sc.Ship(weapon_types=None,
                 max_attack=0,
                 min_attack=0,
                 defense=0,
                 mobility=0,
                 accuracy=0,
                 capacitor=0,
                 signature=0,
                 current_total_points_all=0,
                 ship_name='Ship 1',
                 commander_name=None,
                 damage=0,
                 status='all systems go',
                 shields=None)

ship_2 = sc.Ship(weapon_types=None,
                 max_attack=0,
                 min_attack=0,
                 defense=0,
                 mobility=0,
                 accuracy=0,
                 capacitor=0,
                 signature=0,