Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class GPS_Location:
- def __init__(self, x, y): # makes x and y into x and y attributes respectivly
- self.x = x
- self.y = y
- def __str__(self):
- return '(%s","%s )' % (self.x, self.y) # returns the coordinates as a string
- def __repr__(self):
- thing = 'GPS_Location(%s,%s)' % (self.x, self.y)
- return thing
- def __eq__(self, other):
- if other.x == self.x and other.y == self.y:
- return True
- else:
- return False
- def dist(self, other):
- def dist(self, other):
- return abs(self.x - other.x) + abs(self.y - other.y)
- class GPS_POI:
- def __init__(self, location, name, kind):
- self.location = location
- self.name = name
- self.kind = kind
- def __str__(self):
- '%s: %s, %s' % (self.location, self.name, self.kind)
- def __repr__(self):
- return 'GPS_POI(%s,%s,%s)' % (thing, self.name, self.food)
- class GPS:
- def __init(self, current, map = None):
- self.current = current
- if map == None:
- self.map = []
- else:
- self.map = map
- self.route = route
- def relocate(self, location):
- self.location = current
- def add_dest(self, location):
- self.location = location
- current.append(route)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement