Перенос всей отображаемой публичной информации персонажа в класс. Чистка кода. Комментарии для упрощения навигации.

This commit is contained in:
lopar
2020-07-05 19:43:15 +03:00
parent 3c2816c400
commit e01bba54f8
3 changed files with 44 additions and 38 deletions

View File

@@ -79,56 +79,56 @@ EMPTY_SLOT;
} else {
$this->showItem(1);
}
echo '</div>';
echo '</div><!-- slot-1 -->';
echo '<div class="slot-2">';
if (isset($dressed_item[2])) {
$this->showItem($dressed_item[2]);
} else {
$this->showItem(2);
}
echo '</div>';
echo '</div><!-- slot-2 -->';
echo '<div class="slot-3">';
if (isset($dressed_item[3])) {
$this->showItem($dressed_item[3]);
} else {
$this->showItem(3);
}
echo '</div>';
echo '</div><!-- slot-3 -->';
echo '<div class="slot-4">';
if (isset($dressed_item[4])) {
$this->showItem($dressed_item[4]);
} else {
$this->showItem(4);
}
echo '</div>';
echo '</div><!-- slot-4 -->';
echo '<div class="slot-5">';
if (isset($dressed_item[5])) {
$this->showItem($dressed_item[5]);
} else {
$this->showItem(5);
}
echo '</div>';
echo '</div><!-- slot-5 -->';
echo '<div class="slot-6">';
if (isset($dressed_item[6])) {
$this->showItem($dressed_item[6]);
} else {
$this->showItem(6);
}
echo '</div>';
echo '</div><!-- slot-6 -->';
echo '<div class="slot-7">';
if (isset($dressed_item[7])) {
$this->showItem($dressed_item[7]);
} else {
$this->showItem(7);
}
echo '</div>';
echo '</div><!-- slot-7 -->';
echo '<div class="slot-8">';
if (isset($dressed_item[8])) {
$this->showItem($dressed_item[8]);
} else {
$this->showItem(8);
}
echo '</div>';
echo '</div><!-- slot-8 -->';
echo '<div class="slot-lower">';
if (isset($dressed_item[9])) {
$this->showItem($dressed_item[9]);
@@ -145,27 +145,37 @@ EMPTY_SLOT;
} else {
$this->showItem(11);
}
echo '</div>';
echo '</div><!-- slot-lower -->';
echo '<div class="slot-image">';
echo sprintf('<img src="/i/shadow/%s" width="200" height="430" alt="%s">', $this->shadow, $this->login);
echo '</div>';
echo '</div><!-- slot-image -->';
echo '<div class="user-signs">';
echo sprintf('<img src="i/zodiac/%s.png" alt="Родовой знак">', star_sign($this->borndate));
echo '</div>';
echo '</div><!-- user-signs -->';
echo '<div class="user-info">';
echo '<div class="stats-container">';
echo '<div class="column">';
echo 'Уровень<br>Сила<br>Ловкость<br>Интуиция<br>Выносливость<br>Интеллект<br>Мудрость<br>Находится в:';
echo '</div>';
echo '</div><!-- column -->';
echo '<div class="column">';
echo $this->level . '<br>' . $this->strength . '<br>' . $this->dexterity . '<br>' . $this->intuition . '<br>' . $this->endurance . '<br>' . $this->intelligence . '<br>' . $this->wisdom . '<br>' . $this->getRoomName($this->room);
echo '</div>';
echo '</div>';
echo '</div><!-- column -->';
echo '</div><!-- stats-container -->';
if ($this->married) {
echo sprintf('<a href = "inf.php?%s" target = _blank ><img alt = "В браке с %s" src = "i/married.gif" title = "В браке с %s"></a >', $this->married, $this->married, $this->married);
}
echo '</div>';
echo '</div>';
echo '</div><!-- user-info -->';
echo '</div><!-- user-info-container -->';
echo '<hr><!-- Нижняя часть -->';
echo '<div class="user-info-container-lower">';
echo '<h2>Об игроке</h2>';
if ($this->realname) {
echo sprintf('Имя: %s<br>', $this->realname);
}
if ($this->info) {
echo nl2br($this->info);
}
echo '</div><!-- user-info-container-lower -->';
}
}