<?php
abstract class AbstractUpdate {
protected $player;
protected $optionName;
public function __construct($parArguments, $parPlayer, $parModuleName) {
$this->blockX = $parArguments[0];
$this->blockY = $parArguments[1];
$this->blockZ = $parArguments[2];
$this->blockHalfWidth = $parArguments[3];
$this->blockHalfHeight = $parArguments[4];
$this->timestamp = $parArguments[5];
$this->newBlocksId = explode(Constante::$SEP_URL_2, $parArguments[6]);
$this->optionName = $parModuleName;
$locArrayForOptions = explode(Constante::$SEP_URL_2, $parArguments[7]);
$this->options = array();
for($i=0; $i < count($locArrayForOptions); $i+=2) {
if($locArrayForOptions[$i] == $parModuleName) {
$locArrayForOptions = explode(Constante::$SEP_URL_3, $locArrayForOptions[$i+1]);
for($i=0; $i < count($locArrayForOptions); $i+=2) {
$this->options[$locArrayForOptions[$i]] = $locArrayForOptions[$i+1];
}
break;
}
}
$this->selectionnedId = $parArguments[8];
$this->player = $parPlayer;
}
public function getOptions($parKey, $parDefaultValue=false) {
if(!isset($this->options[$parKey])) {
return $parDefaultValue;
}
return $this->options[$parKey];
}
protected function echoOptionNameOpen() {
echo "<".$this->optionName.">";
}
protected function echoOptionNameClose() {
echo "</".$this->optionName.">";
}
public abstract function echoUpdate();
}
?>