Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Army Manager solution in Clear category for Army Units by MrPod
class Army:
def train_swordsman(self, name):
pass
def train_lancer(self, name):
pass
def train_archer(self, name):
pass
class Swordsman(object):
def __init__(self, name, post, army_name):
self.name = name
self.post = post
self.army_name = army_name
def introduce(self):
return ' '.join((self.post, self.name, ' ', self.army_name, 'swordsman')).replace(' ', ', ')
class Lancer(object):
def __init__(self, name, post, army_name):
self.name = name
self.post = post
self.army_name = army_name
def introduce(self):
return ' '.join((self.post, self.name, ' ', self.army_name, 'lancer')).replace(' ', ', ')
class Archer(object):
def __init__(self, name, post, army_name):
self.name = name
self.post = post
self.army_name = army_name
def introduce(self):
return ' '.join((self.post, self.name, ' ', self.army_name, 'archer')).replace(' ', ', ')
class AsianArmy(Army):
def train_swordsman(self, name):
return Swordsman(name, 'Samurai', 'Asian')
def train_lancer(self, name):
return Lancer(name, 'Ronin', 'Asian')
def train_archer(self, name):
return Archer(name, 'Shinobi', 'Asian')
class EuropeanArmy(Army):
def train_swordsman(self, name):
return Swordsman(name, 'Knight', 'European')
def train_lancer(self, name):
return Lancer(name, 'Raubritter', 'European')
def train_archer(self, name):
return Archer(name, 'Ranger', 'European')
Aug. 12, 2018