def init(): global initialized if (initialized): return for size in SIZES: parts[size] = {} configPath = os.path.join(os.path.dirname(__file__), "data", "parts_%s.cfg" % TYPE_ABBRS[size]) configDict = ConfigFile.readFile(configPath) allReactors = [] allThrusters = [] allGyros = [] for partName in configDict.keys(): if (type(configDict[partName]) != type({})): continue parts[size][partName] = Part(configDict[partName]) if (parts[size][partName].mass != 0): if (parts[size][partName].power < 0): allReactors.append((parts[size][partName], -parts[size][partName].power, parts[size][partName].mass)) if (parts[size][partName].thrust > 0): allThrusters.append((parts[size][partName], parts[size][partName].thrust, parts[size][partName].mass)) if (parts[size][partName].turn > 0): allGyros.append((parts[size][partName], parts[size][partName].turn, parts[size][partName].mass)) reactors[size] = prioritizeByEfficiency(allReactors) thrusters[size] = prioritizeByEfficiency(allThrusters) gyros[size] = prioritizeByEfficiency(allGyros) initialized = True
def init(): global initialized if (initialized): return Classes.init() configPath = os.path.join(os.path.dirname(__file__), "data", "profiles.cfg") configDict = ConfigFile.readFile(configPath) for profName in configDict.keys(): if (type(configDict[profName]) != type({})): continue profiles[profName] = Profile(configDict[profName]) initialized = True
def init(): global initialized if (initialized): return configPath = os.path.join(os.path.dirname(__file__), "data", "materials.cfg") configDict = ConfigFile.readFile(configPath) materials[EXTERIOR_DEFAULT] = Material(EXTERIOR_DEFAULT, EXTERIOR_CONFIG) materials[INTERIOR_DEFAULT] = Material(INTERIOR_DEFAULT, INTERIOR_CONFIG) for materialName in configDict.keys(): if (type(configDict[materialName]) != type({})): continue materials[materialName] = Material(materialName, configDict[materialName]) initialized = True
def init(): global initialized if (initialized): return Parts.init() configPath = os.path.join(os.path.dirname(__file__), "data", "rooms.cfg") configDict = ConfigFile.readFile(configPath) rooms[EXTERIOR] = Room(EXTERIOR_CONFIG) for roomName in configDict.keys(): if (type(configDict[roomName]) != type({})): continue rooms[roomName] = Room(configDict) initialized = True
def init(): global initialized if (initialized): return configPath = os.path.join(os.path.dirname(__file__), "data", "dists.cfg") configDict = ConfigFile.readFile(configPath) for distName in configDict.keys(): if (type(configDict[distName]) != type("")): continue probs = [float(x) for x in configDict[distName].split() if x] if (not probs): continue dists[distName] = Distribution(probs) initialized = True
def init(): global initialized if (initialized): return Dists.init() Parts.init() Rooms.init() for (shipType, typeAbbr) in TYPE_ABBRS.items(): classes[shipType] = {} configPath = os.path.join(os.path.dirname(__file__), "data", "classes_%s.cfg" % typeAbbr) configDict = ConfigFile.readFile(configPath) for className in configDict.keys(): if (type(configDict[className]) != type({})): continue classes[shipType][className] = ShipClass(shipType, configDict[className]) initialized = True