2019-01-04 16:54:38 +00:00
|
|
|
|
|
|
|
def formatted_item_listing(item):
|
2019-01-14 20:20:16 +00:00
|
|
|
return "{} {} for {}D".format(item["amount"], item["item_name"], item["price"])
|
|
|
|
|
|
|
|
|
|
|
|
def formatted_location(location):
|
|
|
|
if location["tunnel"] is not None:
|
|
|
|
tunnel = "**{}** ".format(location["tunnel"])
|
|
|
|
else:
|
|
|
|
tunnel = ""
|
|
|
|
|
|
|
|
return '**{}** @ **{}** {}Owner: **{}**'.format(location["name"], formatted_position(location), tunnel,
|
|
|
|
location["owner"]["name"])
|
|
|
|
|
|
|
|
|
|
|
|
def formatted_tunnel(tunnel):
|
|
|
|
return '**{} {}**: {}'.format(tunnel["tunnel_direction"], tunnel["tunnel_number"], tunnel["location_name"])
|
|
|
|
|
|
|
|
|
|
|
|
def formatted_position(location):
|
|
|
|
return '(x={}, z={})'.format(location["x_coord"], location["z_coord"])
|
|
|
|
|
|
|
|
|
|
|
|
def formatted_shop(shop):
|
|
|
|
inventory = ""
|
|
|
|
for item in shop["items"]:
|
|
|
|
inventory = inventory + "\n" + (formatted_item_listing(item))
|
|
|
|
|
|
|
|
return formatted_location(shop) + inventory
|