Created
September 10, 2015 15:21
-
-
Save lopezjurip/52f933f2f21eb944a991 to your computer and use it in GitHub Desktop.
[Python] - Actividad para Diseño Detallado de Software
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
#!/usr/bin/env python3 | |
# coding=utf-8 | |
class Jugador: | |
def __init__(self, numero, nombre, posicion): | |
self.numero = numero | |
self.nombre = nombre | |
self.posicion = posicion | |
def recibir_pelota(self, pelota): | |
self.patear(pelota) | |
# ... | |
# Do a barrel roll | |
# ... | |
def patear(self, pelota): | |
print("La pateo", pelota) | |
def corre(self): | |
print("corro") | |
class Arquero(Jugador): | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
def recibir_pelota(self, pelota): | |
if (pelota.in_area): | |
self.mano(pelota) | |
else: | |
super().recibir_pelota(pelota) | |
def mano(self, pelota): | |
print("La atajé ", pelota) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment