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