From f08cefe67279d0bd4148634c37e90dc8629cec74 Mon Sep 17 00:00:00 2001 From: Albert Gomis Date: Mon, 30 Jan 2023 18:51:17 +0100 Subject: [PATCH] final commit --- ClassExtended.php | 28 ++++++++++++++++++++++++++++ ClassPlayers.php | 34 ++++++++++++++++++++++++++++++++++ abstractClass.php | 10 ++++++++++ interface.php | 15 +++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 ClassExtended.php create mode 100644 ClassPlayers.php create mode 100644 abstractClass.php create mode 100644 interface.php diff --git a/ClassExtended.php b/ClassExtended.php new file mode 100644 index 0000000..6d11f0b --- /dev/null +++ b/ClassExtended.php @@ -0,0 +1,28 @@ + strPosicion = $posicion; + parent::__construct($nombre, $numero, $posicion); + } + + public function perdidaAcabadaenGol(){ + echo $this -> strNombre . "pierde el balón y termina en gol
"; + } + + public function pase(){ + echo $this -> strNombre . "hace un buen pase
"; + } + +} + + +$newDefender = new Defender("Albert", "Defensa Central", 14); + +$player -> perdida(); \ No newline at end of file diff --git a/ClassPlayers.php b/ClassPlayers.php new file mode 100644 index 0000000..06e1042 --- /dev/null +++ b/ClassPlayers.php @@ -0,0 +1,34 @@ + strNombre = $nombre; + $this -> strPosicion = $posicion; + $this -> intNumero = $numero; + } + + public function pase(){ + echo $this -> strNombre . " pasa la pelota
"; + } + + public function chute(){ + echo $this -> strNombre . " chuta la pelota
"; + } + + public function perdida(){ + echo $this -> strNombre . " pierde la pelota
"; + } + + public function __destruct(){ + echo "
The player is " . $this->strNombre; + } +} + +$player = new Player("Neymar", "Delantero", 10); + +$player -> perdida(); \ No newline at end of file diff --git a/abstractClass.php b/abstractClass.php new file mode 100644 index 0000000..5f00651 --- /dev/null +++ b/abstractClass.php @@ -0,0 +1,10 @@ + $name; + } + + public function fichar($name){ + echo "Se ha fichado a " . $this -> $name; + } + +} \ No newline at end of file