From eea37de9fd7847590fb2502ca5655cb8b55d625a Mon Sep 17 00:00:00 2001 From: Alexander Tolmachev Date: Sun, 9 Dec 2012 23:11:07 +0400 Subject: [PATCH] Drawing is moved to DrawingActorVisitor --- tolmachev_co/actors/actor.py | 3 --- tolmachev_co/actors/alcoholic.py | 5 +---- tolmachev_co/actors/beggar.py | 5 +---- tolmachev_co/actors/bottle.py | 3 --- tolmachev_co/actors/lamp.py | 3 --- tolmachev_co/actors/pilllar.py | 3 --- tolmachev_co/actors/policeman.py | 3 --- tolmachev_co/actors/tavern.py | 3 --- 8 files changed, 2 insertions(+), 26 deletions(-) diff --git a/tolmachev_co/actors/actor.py b/tolmachev_co/actors/actor.py index 89f6ad0..8610caf 100644 --- a/tolmachev_co/actors/actor.py +++ b/tolmachev_co/actors/actor.py @@ -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") diff --git a/tolmachev_co/actors/alcoholic.py b/tolmachev_co/actors/alcoholic.py index c8d3ac7..4bf3eea 100644 --- a/tolmachev_co/actors/alcoholic.py +++ b/tolmachev_co/actors/alcoholic.py @@ -31,7 +31,4 @@ def make_asleep(self): def drop_a_bottle(self): self.__has_bottle = False - return Bottle() - - def draw(self): - print 'A', \ No newline at end of file + return Bottle() \ No newline at end of file diff --git a/tolmachev_co/actors/beggar.py b/tolmachev_co/actors/beggar.py index 8c6210b..35267a4 100644 --- a/tolmachev_co/actors/beggar.py +++ b/tolmachev_co/actors/beggar.py @@ -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', \ No newline at end of file + return self.__current_state == BeggarState.AT_THE_TAVERN \ No newline at end of file diff --git a/tolmachev_co/actors/bottle.py b/tolmachev_co/actors/bottle.py index 0458cdf..329d075 100644 --- a/tolmachev_co/actors/bottle.py +++ b/tolmachev_co/actors/bottle.py @@ -3,6 +3,3 @@ class Bottle (Actor): def accept_visitor(self, visitor): visitor.visit_bottle(self) - - def draw(self): - print '~', \ No newline at end of file diff --git a/tolmachev_co/actors/lamp.py b/tolmachev_co/actors/lamp.py index 79e26d3..a6410b8 100644 --- a/tolmachev_co/actors/lamp.py +++ b/tolmachev_co/actors/lamp.py @@ -3,6 +3,3 @@ class Lamp (Actor): def accept_visitor(self, visitor): visitor.visit_lamp(self) - - def draw(self): - print 'o', \ No newline at end of file diff --git a/tolmachev_co/actors/pilllar.py b/tolmachev_co/actors/pilllar.py index 633adb8..6c67ec7 100644 --- a/tolmachev_co/actors/pilllar.py +++ b/tolmachev_co/actors/pilllar.py @@ -3,6 +3,3 @@ class Pillar (Actor): def accept_visitor(self, visitor): visitor.visit_pillar(self) - - def draw(self): - print '|', diff --git a/tolmachev_co/actors/policeman.py b/tolmachev_co/actors/policeman.py index 2a1a8bb..2741b53 100644 --- a/tolmachev_co/actors/policeman.py +++ b/tolmachev_co/actors/policeman.py @@ -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', diff --git a/tolmachev_co/actors/tavern.py b/tolmachev_co/actors/tavern.py index 81a292d..3724803 100644 --- a/tolmachev_co/actors/tavern.py +++ b/tolmachev_co/actors/tavern.py @@ -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