Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Ship(object):·
- ·
- def make_ship(type):·
- if type == "shuttle":·
- return Shuttle()·
- if type == "freighter":·
- return Freighter()·
- if type == "frigate":·
- return Frigate()·
- #assert 0, "No such ship class %s" % type·
- cemit("space", "Invalid type passed to Ship.make_ship().")·
- return None·
- ·
- make_ship = staticmethod(make_ship)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement