GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — ColdWaters-DotModCampaignChecker/waypoints.py at main · DotModGroup/ColdWaters-DotModCampaignChecker Expand file tree/ Copy pathwaypoints.pyMore file actions 126 lines (103 loc) · 5.21 KB / Copy pathwaypoints.pyFile metadata and controls126 lines (103 loc) · 5.21 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 """This file stores the Waypoints class, which store information about a campaign's waypoints Classes: Waypoints: Stores a campaign's waypoint data """ from sea_waypoint import SeaWaypoint from land_waypoint import LandWaypoint class Waypoints: """This class stores all of the waypoints in the campaign Attributes: land_waypoints: list[LandWaypoint] | A list containing all of the land waypoints sea_waypoints: list[SeaWaypoint] | A list containing all of the sea waypoints """ def __init__(self, camapaign_directory) -> None: self.sea_waypoints: list[SeaWaypoint] | None = [] self.land_waypoints: list[LandWaypoint] | None = [] waypoint_sea_filepath = f"{camapaign_directory}\\waypoints_sea.txt" waypoint_land_filepath = f"{camapaign_directory}\\waypoints_region.txt" try: with open(waypoint_sea_filepath, encoding="utf8") as waypoint_sea_file: current_waypoint_name: str = "" current_waypoint_north: list[str] = [] current_waypoint_south: list[str] = [] current_waypoint_east: list[str] = [] current_waypoint_west: list[str] = [] for line in waypoint_sea_file.readlines(): if line.startswith("WaypointName="): if current_waypoint_name: self.sea_waypoints.append( SeaWaypoint( current_waypoint_name, current_waypoint_north, current_waypoint_south, current_waypoint_east, current_waypoint_west, ) ) current_waypoint_name = line.strip().split("=")[1] current_waypoint_north = [] current_waypoint_south = [] current_waypoint_east = [] current_waypoint_west = [] if line.startswith("NorthWaypoints="): current_waypoint_north = line.strip().split("=")[1].split(",") if line.startswith("SouthWaypoints="): current_waypoint_south = line.strip().split("=")[1].split(",") if line.startswith("EastWaypoints="): current_waypoint_east = line.strip().split("=")[1].split(",") if line.startswith("WestWaypoints="): current_waypoint_west = line.strip().split("=")[1].split(",") if current_waypoint_name: self.sea_waypoints.append( SeaWaypoint( current_waypoint_name, current_waypoint_north, current_waypoint_south, current_waypoint_east, current_waypoint_west, ) ) except FileNotFoundError: self.sea_waypoints = None try: with open(waypoint_land_filepath, encoding="utf8") as waypoint_land_file: current_waypoint_name = "" current_waypoint_alignment: str = "" current_waypoint_connected_to: list[str] = [] current_waypoint_invaded_by: list[str] = [] for line in waypoint_land_file: if line.startswith("WaypointName="): if current_waypoint_name: self.land_waypoints.append( LandWaypoint( current_waypoint_name, current_waypoint_alignment, current_waypoint_connected_to, current_waypoint_invaded_by, ) ) current_waypoint_name = line.strip().split("=")[1] current_waypoint_alignment = "" current_waypoint_connected_to = [] current_waypoint_invaded_by = [] if line.startswith("Alignment="): current_waypoint_alignment = line.strip().split("=")[1] if line.startswith("ConnectedZones="): current_waypoint_connected_to = ( line.strip().split("=")[1].split(",") ) if line.startswith("InvadedBy="): current_waypoint_invaded_by = ( line.strip().split("=")[1].split(",") ) if current_waypoint_name: self.land_waypoints.append( LandWaypoint( current_waypoint_name, current_waypoint_alignment, current_waypoint_connected_to, current_waypoint_invaded_by, ) ) except FileNotFoundError: self.land_waypoints = None |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |