def create_duplicate(self, unit): if unit.duplication_unit == MELEE_UNIT: return MeleeUnit( *Move.transform(unit.x, unit.y, unit.stasis_direction)) else: return WorkerUnit( *Move.transform(unit.x, unit.y, unit.stasis_direction))
def create_tile_or_unit(self, tile_code, player, x, y, base_y): if tile_code.lower() == 'x': return WallTile() elif tile_code.lower() == 'r': return ResourceTile() elif tile_code.lower() == 'm': self.add_unit(player, MeleeUnit(x, y + base_y)) elif tile_code.lower() == 'w': self.add_unit(player, WorkerUnit(x, y + base_y)) return GroundTile()
def create_duplicate(self, unit): return MeleeUnit( *Move.transform(unit.x, unit.y, unit.stasis_direction))