diff --git a/src/ARENAS.php b/src/ARENAS.php deleted file mode 100644 index edda28e..0000000 --- a/src/ARENAS.php +++ /dev/null @@ -1,77 +0,0 @@ - "tictactoe", - 'url' => "/tictactoe", - 'title' => "Tic Tac Toe", - 'metaDescription' => 'Affrontements de bots au TicTacToe, morpion', - 'jsFile'=> "js.js", - 'cssFile'=> "style.css", - 'ludusUrl' => "/testBotScripts/tictactoe.html" - */ - public function get_id(){ - return $this->id; - } - public function get_css_code(){ - return file_get_contents($this->path.$this->cssFile); - } - public function get_js_code(){ - return file_get_contents($this->path.$this->jsFile); - } - public function get_title(){ - return $this->title; - } - public function get_meta_description(){ - return $this->metaDescription; - } - public function get_ludus_url(){ - return $this->ludusUrl; - } - public function get_doc($lang){ - if(file_exists($this->path."doc-".$lang.".html")) return file_get_contents($this->path."doc-".$lang.".html"); - if(file_exists($this->path."doc-fr.html")) return file_get_contents($this->path."doc-fr.html"); - return ""; - } - - - public function __construct($name){ - $this->name = $name; - $this->path = __DIR__."/arenas/".$name."/"; - - if(!is_dir($this->path)){ - throw new InvalidArenaException("No path containing arena ".$name." found ".__DIR__."/".$name."/"); - } - - $this->bots = new SplStack(); - - } - - public function hydrate($arr){ - foreach ($arr as $key => $value){ - if (property_exists($this,$key)){ - $this->$key = $value; - }else{ - throw new InvalidArenaException("incorrect array key"); - } - } - } - public function addBot(BOT $bot){ - $this->bots->push($bot); - } -} \ No newline at end of file diff --git a/src/BOTS.php b/src/BOTS.php deleted file mode 100644 index bf930e9..0000000 --- a/src/BOTS.php +++ /dev/null @@ -1,46 +0,0 @@ -name = $name; - } - public function hydrate ($arr){ - foreach ($arr as $key => $value){ - if (property_exists($this,$key)){ - $this->$key = $value; - }elseif(is_numeric($key)){ - //rien, on accepte mais prends pas en compte - }else{ - throw new InvalidArenaException("incorrect array key".$key); - } - } - } -} \ No newline at end of file