Skip to content

Commit

Permalink
Moved changes to action
Browse files Browse the repository at this point in the history
  • Loading branch information
qastanley committed Aug 29, 2020
1 parent 0b0b987 commit b8034a6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
15 changes: 14 additions & 1 deletion game/common/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,24 @@ class Action:
def __init__(self):
self.object_type = ObjectType.action
self._example_action = None
self.__destination = None

def set_action(self, action):
self._example_action = action


def get_destination(self):
return self.__destination

def set_destination (self, truck, destination):
if not isinstance(destination, ObjectType.node):
return
if not isinstance(truck, ObjectType.truck):
return
self.current_location = truck.current_node
for road in self.current_location.connections:
if road.city_2 == destination.city_name:
truck.current_node = destination
self.__destination = destination

def to_json(self):
data = dict()
Expand Down
19 changes: 0 additions & 19 deletions game/common/select_route.py

This file was deleted.

Empty file.

0 comments on commit b8034a6

Please sign in to comment.