traktor/Trac.py

30 lines
688 B
Python
Raw Normal View History

2019-04-29 03:49:45 +02:00
from Point import Point
class Trac:
def __init__(self, rotation, position):
self.__position = Point(position.get_cord())
self.__rotation = rotation
def get_symbol(self):
if self.__rotation == 'S':
return 'v'
elif self.__rotation == 'N':
return '^'
elif self.__rotation == 'E':
return '>'
else:
return '<'
2019-04-29 06:52:57 +02:00
def set_rotation(self, rotation):
self.__rotation = rotation
2019-04-29 03:49:45 +02:00
2019-04-29 06:52:57 +02:00
def set_position(self, position):
self.__position.set_cord(position)
2019-04-29 03:49:45 +02:00
def get_position(self):
return self.__position
2019-04-29 06:52:57 +02:00
def get_rotation(self):
return self.__rotation