Example #1
0
 /**
  * @version 0.1.3
  * @since 0.1.0
  * @param string $name Item type name.
  * @return int Type ID.
  * @throws E_OTS_NotLoaded If items list is not loaded.
  * @deprecated 0.1.3 Use POT::getItemsList()->getItemTypeId().
  */
 public function getItemTypeId($name)
 {
     if (isset($this->items)) {
         return $this->items->getItemTypeId($name);
     }
     throw new E_OTS_NotLoaded();
 }
Example #2
0
 /**
  * Loads items list.
  * 
  * <p>
  * This method loads items list from <var>items.xml</var> and <var>items.otb</var> files from given directory. You can create local instances of items lists directly - calling this method will associate loaded list with POT class instance and will make it available everywhere in the code.
  * </p>
  * 
  * <p>
  * Note: Since 0.2.0+SVN this method is static.
  * </p>
  * 
  * @version 0.2.0+SVN
  * @since 0.1.0
  * @param string $path Items information directory.
  * @throws E_OTS_FileLoaderError On binary file loading error.
  */
 public static function loadItems($path)
 {
     self::$items = new OTS_ItemsList();
     // sets items cache if any
     if (isset(self::$itemsCache)) {
         self::$items->setCacheDriver(self::$itemsCache);
     }
     self::$items->loadItems($path);
 }