Exemplo n.º 1
0
def add_world_topography(world_id, global_state_dict, global_lock):
    numeric_seed = int(world_id, 16)
    w = world_one.generate_world(seed=numeric_seed, total_cells_desired=3000)
    t = geography.topography_from_geography(geography.geography_from_everett_world(w))
    # for a in range(30):
    #     logger.debug(u"Waiting for {} seconds...".format(a))
    #     time.sleep(1)
    global_lock.acquire()
    global_state_dict[world_id].topography = t
    global_state_dict[world_id].everett = w
    global_lock.release()
Exemplo n.º 2
0
import matplotlib.pyplot as plt
from everett.features.climate import whittaker
from everett.features import terrain
from everett.worldgenerators import world_one


if __name__ == '__main__':
    def print_node(n):
        if n is not None:
            print(u"Node at: {}".format(n.location))
            print(u"Biome: {}".format(n.biome))
            print(u"Node has neighbours: {}".format(", ".join([str(neighbour.location) for neighbour in n.neighbours])))
            print(u"Downwind neighbour: {}".format(n.downwind_neighbour.location if n.downwind_neighbour.location is not None else None))
            print(u"Features: {}".format(n.features))
    w = world_one.generate_world()

    interrogation = ""
    n = None
    n_list = []
    while interrogation != "quit":
        interrogation = raw_input("Query the world: ")
        if interrogation == "current cell":
            print_node(n)
        elif interrogation == "random cell":
            print(random.choice(w.all_cells))
        elif interrogation == "random node":
            n = random.choice(w.all_boundary_nodes)
            print_node(n)
        elif "," in interrogation:
            try: