Skip to content
This repository has been archived by the owner on Feb 12, 2018. It is now read-only.

Commit

Permalink
Drawing is moved to DrawingActorVisitor
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderTolmachev committed Dec 9, 2012
1 parent 08f70f1 commit eea37de
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 26 deletions.
3 changes: 0 additions & 3 deletions tolmachev_co/actors/actor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
class Actor:
def accept_visitor(self, visitor):
raise NotImplementedError("Abstract method is called")

def draw(self):
raise NotImplementedError("Abstract method is called")
5 changes: 1 addition & 4 deletions tolmachev_co/actors/alcoholic.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,4 @@ def make_asleep(self):

def drop_a_bottle(self):
self.__has_bottle = False
return Bottle()

def draw(self):
print 'A',
return Bottle()
5 changes: 1 addition & 4 deletions tolmachev_co/actors/beggar.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,4 @@ def is_walking_with_a_bottle(self):
return self.__current_state == BeggarState.WALKING_WITH_A_BOTTLE

def is_in_tavern(self):
return self.__current_state == BeggarState.AT_THE_TAVERN

def draw(self):
print 'B',
return self.__current_state == BeggarState.AT_THE_TAVERN
3 changes: 0 additions & 3 deletions tolmachev_co/actors/bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@
class Bottle (Actor):
def accept_visitor(self, visitor):
visitor.visit_bottle(self)

def draw(self):
print '~',
3 changes: 0 additions & 3 deletions tolmachev_co/actors/lamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@
class Lamp (Actor):
def accept_visitor(self, visitor):
visitor.visit_lamp(self)

def draw(self):
print 'o',
3 changes: 0 additions & 3 deletions tolmachev_co/actors/pilllar.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@
class Pillar (Actor):
def accept_visitor(self, visitor):
visitor.visit_pillar(self)

def draw(self):
print '|',
3 changes: 0 additions & 3 deletions tolmachev_co/actors/policeman.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@ def is_walking_to_alcoholic(self):

def is_walking_with_alcoholic(self):
return self.__current_state == PolicemanState.WALKING_WITH_ALCOHOLIC

def draw(self):
print 'P',
3 changes: 0 additions & 3 deletions tolmachev_co/actors/tavern.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ def __init__(self):
def accept_visitor(self, visitor):
visitor.visit_tavern(self)

def draw(self):
pass

def is_time_to_generate_alcoholic(self):
return self.__steps_number_after_alcoholic_generation == 0

Expand Down

0 comments on commit eea37de

Please sign in to comment.