Exemplo n.º 1
0
def techs():
    data.load_techs()
    return g.techs.copy()
Exemplo n.º 2
0
    mydir = osp.dirname(myname)
    esdir = osp.abspath(osp.join(osp.dirname(myname), '..'))
    sys.path.insert(0, esdir)
else:
    myname = __file__
    mydir = osp.dirname(myname)
    esdir = osp.abspath(osp.join(osp.dirname(myname), '..'))
    sys.path.append(esdir)

try:
    from singularity.code import g, dirs, i18n, data
    dirs.create_directories(False)
    i18n.set_language()
    data.load_regions()
    data.load_locations()
    data.load_techs()
    data.load_item_types()
    data.load_items()
    data.load_tasks()
except ImportError:
    sys.exit("Could not find game's code.g")

so_far = ""


def cost(c):
    c = [k / f for f, k in zip([1, 86400, 24 * 60], c)]
    s = ', '.join([
        '%s %s' % (g.to_money(k), label)
        for label, k in zip(["money", "CPU", "days"], c) if k
    ])