POT
POT
POT
Main menu

Download

Forum

SVN

Class: OTS_ItemType

Source Location: /classes/OTS_ItemType.php

Class OTS_ItemType

Class Overview

Item type info.

Item type info. This class represents only item type information. You can't assign it to player. To do that, you need to create instance of this item type (you can use createItem() method to do that).

Located in /classes/OTS_ItemType.php [line 47]



		
				Author(s):
		
API Tags:
Property:  int $clientId: Client ID.
Property:  string $name: Item name.
Property:  int $group: Group.
Property:  int $type: Item type.
Property-read:  int $id: Item type ID.
Property-read:  array $attributesList: List of all attributes.
Property-read:  bool $blocking: Is item blocking move.
Property-read:  bool $hasHeight: Does item have height.
Property-read:  bool $usable: Is item usable.
Property-read:  bool $pickupable: Is player able to pick it up.
Property-read:  bool $movable: Can be moved.
Property-read:  bool $stackable: Can be stacked.
Property-read:  bool $alwaysOnTop: Is always on top of stack.
Property-read:  bool $readable: Has readable sign.
Property-read:  bool $rotable: Can be rotated.
Property-read:  bool $hangable: Can be hang.
Property-read:  bool $vertical: Is verticaly oriented.
Property-read:  bool $horizontal: Is horizontaly oriented.
Property-write:  int $flags: Special flags.

Information Tags:
Version:  0.1.3
Version:  0.0.8
Since:  0.0.8

Methods

[ Top ]
Constant Summary
FLAG_ALLOWDISTREAD   Can be read from distance.
FLAG_ALWAYSONTOP   Is always over other items in stack.
FLAG_BLOCK_PATHFIND   Can block searching for path.
FLAG_BLOCK_PROJECTILE   BLOCK_PROJECTILE flag(?).
FLAG_BLOCK_SOLID   Can block characters from walking.
FLAG_CANNOTDECAY   Doesn't decay.
FLAG_FLOORCHANGEDOWN   Changes floor under it.
FLAG_FLOORCHANGEEAST   Changes floor east from it's position.
FLAG_FLOORCHANGENORTH   Changes floor north from it's position.
FLAG_FLOORCHANGESOUTH   Changes floor south from it's position.
FLAG_FLOORCHANGEWEST   Changes floor west from it's position.
FLAG_HANGABLE   Can be hang(?).
FLAG_HAS_HEIGHT   Does item rises stack height on it's field.
FLAG_HORIZONTAL   Is oriented horizontaly.
FLAG_MOVEABLE   Can be moved by player.
FLAG_PICKUPABLE   Can be picked up by player.
FLAG_READABLE   Has readable sign.
FLAG_ROTABLE   Can be rotated by player.
FLAG_STACKABLE   Can be grouped with another items.
FLAG_USEABLE   Can be used by players.
FLAG_VERTICAL   Is oriented verticaly.
ITEM_GROUP_AMMUNITION   Ammunition.
ITEM_GROUP_ARMOR   Armor.
ITEM_GROUP_CONTAINER   Container.
ITEM_GROUP_DEPRECATED   Deprecated item.
ITEM_GROUP_DOOR   Door.
ITEM_GROUP_FLUID   Liquid thing.
ITEM_GROUP_GROUND   Ground tile.
ITEM_GROUP_KEY   Key.
ITEM_GROUP_MAGICFIELD   Magic field.
ITEM_GROUP_NONE   No group speciffied.
ITEM_GROUP_RUNE   Rune.
ITEM_GROUP_SPLASH   Splash effect.
ITEM_GROUP_TELEPORT   Teleport field.
ITEM_GROUP_WEAPON   Weapon.
ITEM_GROUP_WRITEABLE   Item that can store editable sign.
ITEM_TYPE_CONTAINER   Container.
ITEM_TYPE_DEPOT   Depot locker.
ITEM_TYPE_DOOR   Door.
ITEM_TYPE_MAGICFIELD   Magic field.
ITEM_TYPE_MAILBOX   Mailbox.
ITEM_TYPE_NONE   No special type.
ITEM_TYPE_TELEPORT   Teleport.
ITEM_TYPE_TRASHHOLDER   Trash can.

[ Top ]
Method Summary
static void   __set_state()   Magic PHP5 method.
OTS_Item   createItem()   Creates instance of this type.
string   getAttribute()   Returns given attribute.
array   getAttributesList()   Returns all attributes list.
int   getClientId()   Returns item type client ID.
int   getGroup()   Returns group.
int   getId()   Returns item type server ID.
string   getName()   Returns item name.
int   getType()   Returns item type.
bool   hasAttribute()   Checks if this type has given attribute.
bool   hasHeight()   Checks if item has height.
bool   isAlwaysOnTop()   Checks if item is always on top.
bool   isBlocking()   Checks if item is blocking.
bool   isHangable()   Checks if item can be hanged.
bool   isHorizontal()   Checks if item is horizontal.
bool   isMovable()   Checks if item is movable.
bool   isPickupable()   Checks if item is pickupable.
bool   isReadable()   Checks if item is readable.
bool   isRotable()   Checks if item can be rotated.
bool   isStackable()   Checks if item is stackable.
bool   isUsable()   Checks if item is usable.
bool   isVertical()   Checks if item is vertical.
OTS_ItemType   __construct()   Initializes new item type object.
void   setAttribute()   Sets given attribute.
void   setClientId()   Sets client side ID.
void   setFlags()   Sets type flags.
void   setGroup()   Sets item group.
void   setName()   Sets item type name.
void   setType()   Sets item type.
mixed   __get()   Magic PHP5 method.
void   __set()   Magic PHP5 method.
string   __toString()   Returns string representation of object.

[ Top ]
Methods
static method __set_state  [line 303]

  static void __set_state( array $properties  )

Magic PHP5 method.

Magic PHP5 method. Allows object importing from var_export().

Parameters:
array   $properties:  List of object properties.

API Tags:
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.0.8
Since:  0.0.8

[ Top ]
createItem  [line 595]

  OTS_Item createItem( )

Creates instance of this type.

Creates instance of this type.


API Tags:
Return:  Item instance.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
getAttribute  [line 389]

  string getAttribute( $name, string $attribyte  )

Returns given attribute.

Returns given attribute.

Parameters:
string   $attribyte:  Attribute name.
   $name: 

API Tags:
Return:  Attribute value.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.0.8
Throws:  OutOfBoundsException If not set.
Since:  0.0.8

[ Top ]
getAttributesList  [line 415]

  array getAttributesList( )

Returns all attributes list.

Returns all attributes list.


API Tags:
Return:  List of attributes.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
getClientId  [line 333]

  int getClientId( )

Returns item type client ID.

Returns item type client ID.


API Tags:
Return:  Cient ID.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
getGroup  [line 425]

  int getGroup( )

Returns group.

Returns group.


API Tags:
Return:  Item group.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
getId  [line 323]

  int getId( )

Returns item type server ID.

Returns item type server ID.


API Tags:
Return:  ID.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
getName  [line 353]

  string getName( )

Returns item name.

Returns item name.


API Tags:
Return:  Item type name.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
getType  [line 445]

  int getType( )

Returns item type.

Returns item type.


API Tags:
Return:  Item type.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
hasAttribute  [line 376]

  bool hasAttribute( $name, string $attribyte  )

Checks if this type has given attribute.

Checks if this type has given attribute.

Parameters:
string   $attribyte:  Attribute name.
   $name: 

API Tags:
Return:  Attribute set state.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.0.8
Since:  0.0.8
Since:  0.1.3

[ Top ]
hasHeight  [line 485]

  bool hasHeight( )

Checks if item has height.

Checks if item has height.


API Tags:
Return:  Has item height.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isAlwaysOnTop  [line 535]

  bool isAlwaysOnTop( )

Checks if item is always on top.

Checks if item is always on top.


API Tags:
Return:  Is item always on top.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isBlocking  [line 475]

  bool isBlocking( )

Checks if item is blocking.

Checks if item is blocking.


API Tags:
Return:  Is item blocking.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isHangable  [line 565]

  bool isHangable( )

Checks if item can be hanged.

Checks if item can be hanged.


API Tags:
Return:  Is item can be hanged.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isHorizontal  [line 585]

  bool isHorizontal( )

Checks if item is horizontal.

Checks if item is horizontal.


API Tags:
Return:  Is item horizontal.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isMovable  [line 515]

  bool isMovable( )

Checks if item is movable.

Checks if item is movable.


API Tags:
Return:  Is item movable.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isPickupable  [line 505]

  bool isPickupable( )

Checks if item is pickupable.

Checks if item is pickupable.


API Tags:
Return:  Is item pickuable.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isReadable  [line 545]

  bool isReadable( )

Checks if item is readable.

Checks if item is readable.


API Tags:
Return:  Is item readable.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isRotable  [line 555]

  bool isRotable( )

Checks if item can be rotated.

Checks if item can be rotated.


API Tags:
Return:  Is item can be rotated.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isStackable  [line 525]

  bool isStackable( )

Checks if item is stackable.

Checks if item is stackable.


API Tags:
Return:  Is item stackable.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isUsable  [line 495]

  bool isUsable( )

Checks if item is usable.

Checks if item is usable.


API Tags:
Return:  Is item usable.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
isVertical  [line 575]

  bool isVertical( )

Checks if item is vertical.

Checks if item is vertical.


API Tags:
Return:  Is item vertical.
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
Constructor __construct  [line 288]

  OTS_ItemType __construct( int $id  )

Initializes new item type object.

Initializes new item type object.

Parameters:
int   $id:  Server ID.

API Tags:
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
setAttribute  [line 405]

  void setAttribute( $name, string $value, string $attribute  )

Sets given attribute.

Sets given attribute.

Parameters:
string   $attribute:  Attribute name.
string   $value:  Attribute value.
   $name: 

API Tags:
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
setClientId  [line 343]

  void setClientId( int $clientId  )

Sets client side ID.

Sets client side ID.

Parameters:
int   $clientId:  Client ID.

API Tags:
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
setFlags  [line 465]

  void setFlags( int $flags  )

Sets type flags.

Sets type flags.

Parameters:
int   $flags:  Flags.

API Tags:
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
setGroup  [line 435]

  void setGroup( int $group  )

Sets item group.

Sets item group.

Parameters:
int   $group:  Group.

API Tags:
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
setName  [line 363]

  void setName( string $name  )

Sets item type name.

Sets item type name.

Parameters:
string   $name:  Name.

API Tags:
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
setType  [line 455]

  void setType( int $type  )

Sets item type.

Sets item type.

Parameters:
int   $type:  Type.

API Tags:
Access:  public

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
__get  [line 618]

  mixed __get( string $name  )

Magic PHP5 method.

Magic PHP5 method.

Parameters:
string   $name:  Property name.

API Tags:
Return:  Property value.
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.8
Throws:  OutOfBoundsException For non-supported properties.
Since:  0.1.0
Since:  0.0.8

[ Top ]
__set  [line 690]

  void __set( string $name, mixed $value  )

Magic PHP5 method.

Magic PHP5 method.

Parameters:
string   $name:  Property name.
mixed   $value:  Property value.

API Tags:
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.8
Throws:  OutOfBoundsException For non-supported properties.
Since:  0.1.0
Since:  0.0.8

[ Top ]
__toString  [line 730]

  string __toString( )

Returns string representation of object.

Returns string representation of object. If any display driver is currently loaded then it uses it's method. Otherwise just returns item ID.


API Tags:
Return:  String representation of object.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.0.8
Since:  0.0.8
Since:  0.1.3

[ Top ]
Constants
FLAG_ALLOWDISTREAD = 1048576 [line 232]

Can be read from distance.

Can be read from distance.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_ALWAYSONTOP = 8192 [line 204]

Is always over other items in stack.

Is always over other items in stack.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_BLOCK_PATHFIND = 4 [line 160]

Can block searching for path.

Can block searching for path.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_BLOCK_PROJECTILE = 2 [line 156]

BLOCK_PROJECTILE flag(?).

BLOCK_PROJECTILE flag(?).

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_BLOCK_SOLID = 1 [line 152]

Can block characters from walking.

Can block characters from walking.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_CANNOTDECAY = 524288 [line 228]

Doesn't decay.

Doesn't decay.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_FLOORCHANGEDOWN = 256 [line 184]

Changes floor under it.

Changes floor under it.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_FLOORCHANGEEAST = 1024 [line 192]

Changes floor east from it's position.

Changes floor east from it's position.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_FLOORCHANGENORTH = 512 [line 188]

Changes floor north from it's position.

Changes floor north from it's position.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_FLOORCHANGESOUTH = 2048 [line 196]

Changes floor south from it's position.

Changes floor south from it's position.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_FLOORCHANGEWEST = 4096 [line 200]

Changes floor west from it's position.

Changes floor west from it's position.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_HANGABLE = 65536 [line 216]

Can be hang(?).

Can be hang(?).

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_HAS_HEIGHT = 8 [line 164]

Does item rises stack height on it's field.

Does item rises stack height on it's field.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_HORIZONTAL = 262144 [line 224]

Is oriented horizontaly.

Is oriented horizontaly.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_MOVEABLE = 64 [line 176]

Can be moved by player.

Can be moved by player.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_PICKUPABLE = 32 [line 172]

Can be picked up by player.

Can be picked up by player.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_READABLE = 16384 [line 208]

Has readable sign.

Has readable sign.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_ROTABLE = 32768 [line 212]

Can be rotated by player.

Can be rotated by player.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_STACKABLE = 128 [line 180]

Can be grouped with another items.

Can be grouped with another items.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_USEABLE = 16 [line 168]

Can be used by players.

Can be used by players.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
FLAG_VERTICAL = 131072 [line 220]

Is oriented verticaly.

Is oriented verticaly.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_AMMUNITION = 4 [line 68]

Ammunition.

Ammunition.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_ARMOR = 5 [line 72]

Armor.

Armor.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_CONTAINER = 2 [line 60]

Container.

Container.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_DEPRECATED = 14 [line 111]

Deprecated item.

Deprecated item.

Information Tags:
Version:  0.1.0
Version:  0.0.8
Since:  0.0.8
Since:  0.1.0

[ Top ]
ITEM_GROUP_DOOR = 13 [line 104]

Door.

Door.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_FLUID = 12 [line 100]

Liquid thing.

Liquid thing.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_GROUND = 1 [line 56]

Ground tile.

Ground tile.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_KEY = 10 [line 92]

Key.

Key.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_MAGICFIELD = 8 [line 84]

Magic field.

Magic field.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_NONE = 0 [line 52]

No group speciffied.

No group speciffied.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_RUNE = 6 [line 76]

Rune.

Rune.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_SPLASH = 11 [line 96]

Splash effect.

Splash effect.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_TELEPORT = 7 [line 80]

Teleport field.

Teleport field.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_WEAPON = 3 [line 64]

Weapon.

Weapon.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_GROUP_WRITEABLE = 9 [line 88]

Item that can store editable sign.

Item that can store editable sign.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_TYPE_CONTAINER = 4 [line 132]

Container.

Container.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_TYPE_DEPOT = 1 [line 120]

Depot locker.

Depot locker.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_TYPE_DOOR = 5 [line 136]

Door.

Door.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_TYPE_MAGICFIELD = 6 [line 140]

Magic field.

Magic field.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_TYPE_MAILBOX = 2 [line 124]

Mailbox.

Mailbox.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_TYPE_NONE = 0 [line 116]

No special type.

No special type.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]
ITEM_TYPE_TELEPORT = 7 [line 147]

Teleport.

Teleport.

Information Tags:
Version:  0.1.0
Version:  0.0.8
Since:  0.0.8
Since:  0.1.0

[ Top ]
ITEM_TYPE_TRASHHOLDER = 3 [line 128]

Trash can.

Trash can.

Information Tags:
Version:  0.0.8
Since:  0.0.8

[ Top ]