Strategy Pattern TestDriver

Here is a simple driver that tests the code I posted here: https://jasonjkeller.wordpress.com/2013/01/25/my-strategy-pattern-strategy/

__author__ = ‘jasonjkeller’

from GodzillaSim import *

def main():

godzilla = Godzilla()
godzilla.performDeclare()
godzilla.performMove()
godzilla.performAttacks()

mothra = Mothra()
mothra.performDeclare()
mothra.performMove()
mothra.performAttacks()

civilian = Civilian()
civilian.performDeclare()
civilian.performMove()

military = Military()
military.performDeclare()
military.performMove()
military.performAttacks()

battleship = Battleship()
battleship.performDeclare()
battleship.performMove()
battleship.performAttacks()

tank = Tank()
tank.performDeclare()
tank.performMove()
tank.performAttacks()
boat = Boat()
boat.Display()

building = Building()
building.Display()

tree = Tree()
tree.Display()

oceanbg = OceanBG()
oceanbg.Display()

citybg = CityBG()
citybg.Display()

main()

 

 

Here is the output produced by the driver:

 

/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python /Users/jasonjkeller/PycharmProjects/GodzillaSim/GodzillaSimDriver.py
Godzilla declares: ROOOAAAAAR!!!
I’m walking around!
I’m breathing fire at you!
Mothra declares: BZZZzzz!!!
I’m flying around!
I’m shooting a laser beam at you!
Civilian declares: Run for your life!!!
I’m running away!
Military declares: Fire your weapons!!!
I’m walking around!
I’m shooting my gun at you!
Battleship declares: Fire your battleship weapons!!!
I’m floating around!
I’m shooting my gun at you!
Tank declares: Fire your tank cannon!!!
I’m driving around!
I’m shooting my gun at you!
I am an inanimate boat.
I am an inanimate building.
I am an inanimate tree.
I am an Ocean location.
I am a City location.

Process finished with exit code 0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s