| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- /**
- * Skill level entity file.
- *
- * Creates the entity and makes it available.
- *
- * @category Entity
- */
- /**
- * Require dependent entities if not present.
- */
- require_once(PATH::ENTITY . "Entity.php");
- /**
- * Monster skill level.
- *
- * Represents an object from the table 'k_monster_skill_upgrade'.
- *
- * @category Entity
- */
- class K_Skill_Level extends Entity{
- /**
- * @var int Skill identifier.
- */
- public $skill;
- /**
- * @var int Skill level.
- */
- public $level;
- /**
- * @var string Upgrade description.
- */
- public $description;
- /**
- * Constructor.
- *
- * Searches the database and retrieves the information about the
- * skill level, populating it and it's items.
- *
- * @param int $skill Skill identifier.
- * @param int $level Skill level.
- * @global resource Database connection.
- */
- public function __construct($skill, $level){
- global $db;
- $s =
- "SELECT " .
- " skill, " .
- " level, " .
- " description " .
- "FROM k_skill_level " .
- "WHERE " .
- " skill = $skill AND " .
- " level = $level;";
- $q = $db->query($s);
- $r = $q->fetchArray(SQLITE3_ASSOC);
- if ($r){
- $this->skill = $r["skill"];
- $this->level = $r["level"];
- $this->description = HTML::e($r["description"]);
- }
- }
- }
- ?>
|