This repository has been archived by the owner on Feb 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
35 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,3 @@ | |
class Bottle (Actor): | ||
def accept_visitor(self, visitor): | ||
visitor.visit_bottle(self) | ||
|
||
def draw(self): | ||
print '~', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,3 @@ | |
class Lamp (Actor): | ||
def accept_visitor(self, visitor): | ||
visitor.visit_lamp(self) | ||
|
||
def draw(self): | ||
print 'o', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,3 @@ | |
class Pillar (Actor): | ||
def accept_visitor(self, visitor): | ||
visitor.visit_pillar(self) | ||
|
||
def draw(self): | ||
print '|', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from actors.visitors.actor_visitor import ActorVisitor | ||
|
||
class ActorDrawingVisitor(ActorVisitor): | ||
def visit_alcoholic(self, alcoholic): | ||
print 'A', | ||
|
||
def visit_beggar(self, beggar): | ||
print 'B', | ||
|
||
def visit_pillar(self, pillar): | ||
print '|', | ||
|
||
def visit_lamp(self, lamp): | ||
print 'O', | ||
|
||
def visit_bottle(self, bottle): | ||
print '~', | ||
|
||
def visit_policeman(self, policeman): | ||
print 'P', | ||
|
||
def visit_tavern(self, tavern): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters