Last active
September 1, 2016 06:39
-
-
Save VictorFursa/0c90b3c2b3afdfa74d43523fade8808b to your computer and use it in GitHub Desktop.
Warcraft
This file contains hidden or 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
<?php | |
abstract class Character { | |
protected $spells = []; | |
abstract public function getTalants(); | |
} |
This file contains hidden or 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
<?php | |
require_once "Character.php"; | |
class Mage extends Character { | |
private function Talant(){ | |
return $this->spells = ['Фрост нова', 'ГЛЫБА']; | |
} | |
public function getTalants(){ | |
foreach ($this->Talant() as $value) | |
{ | |
echo $value . '<br>'; | |
} | |
} | |
} | |
$mage = new Mage(); | |
$mage->getTalants(); |
This file contains hidden or 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
<?php | |
require_once "Character.php"; | |
class Warrior extends Character { | |
private function Talant(){ | |
return $this->spells = ['Героический прыжок', 'чардж']; | |
} | |
public function getTalants(){ | |
foreach ($this->Talant() as $value) | |
{ | |
echo $value . '<br>'; | |
} | |
} | |
} | |
$war = new Warrior(); | |
$war->getTalants(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment