Skip to content

Instantly share code, notes, and snippets.

@lopezjurip
Created September 10, 2015 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lopezjurip/52f933f2f21eb944a991 to your computer and use it in GitHub Desktop.
Save lopezjurip/52f933f2f21eb944a991 to your computer and use it in GitHub Desktop.
[Python] - Actividad para Diseño Detallado de Software
#!/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