PHP Class pocketmine\entity\Attribute

Show file Open project: iTXTech/Genisys Class Usage Examples

Protected Properties

Property Type Description
$attributes Attribute[]
$currentValue
$defaultValue
$desynchronized
$maxValue
$minValue
$name
$shouldSend

Public Methods

Method Description
addAttribute ( integer $id, string $name, float $minValue, float $maxValue, float $defaultValue, boolean $shouldSend = true ) : Attribute
getAttribute ( $id ) : null | Attribute
getAttributeByName ( $name ) : null | Attribute
getDefaultValue ( )
getId ( )
getMaxValue ( )
getMinValue ( )
getName ( )
getValue ( )
init ( )
isDesynchronized ( ) : boolean
isSyncable ( )
markSynchronized ( boolean $synced = true )
setDefaultValue ( $defaultValue )
setMaxValue ( $maxValue )
setMinValue ( $minValue )
setValue ( $value, boolean $fit = true, boolean $shouldSend = false )

Private Methods

Method Description
__construct ( $id, $name, $minValue, $maxValue, $defaultValue, $shouldSend = true )

Method Details

addAttribute() public static method

public static addAttribute ( integer $id, string $name, float $minValue, float $maxValue, float $defaultValue, boolean $shouldSend = true ) : Attribute
$id integer
$name string
$minValue float
$maxValue float
$defaultValue float
$shouldSend boolean
return Attribute

getAttribute() public static method

public static getAttribute ( $id ) : null | Attribute
$id
return null | Attribute

getAttributeByName() public static method

public static getAttributeByName ( $name ) : null | Attribute
$name
return null | Attribute

getDefaultValue() public method

public getDefaultValue ( )

getId() public method

public getId ( )

getMaxValue() public method

public getMaxValue ( )

getMinValue() public method

public getMinValue ( )

getName() public method

public getName ( )

getValue() public method

public getValue ( )

init() public static method

public static init ( )

isDesynchronized() public method

public isDesynchronized ( ) : boolean
return boolean

isSyncable() public method

public isSyncable ( )

markSynchronized() public method

public markSynchronized ( boolean $synced = true )
$synced boolean

setDefaultValue() public method

public setDefaultValue ( $defaultValue )

setMaxValue() public method

public setMaxValue ( $maxValue )

setMinValue() public method

public setMinValue ( $minValue )

setValue() public method

public setValue ( $value, boolean $fit = true, boolean $shouldSend = false )
$fit boolean
$shouldSend boolean

Property Details

$attributes protected static property

protected static Attribute[],pocketmine\entity $attributes
return Attribute[]

$currentValue protected property

protected $currentValue

$defaultValue protected property

protected $defaultValue

$desynchronized protected property

protected $desynchronized

$maxValue protected property

protected $maxValue

$minValue protected property

protected $minValue

$name protected property

protected $name

$shouldSend protected property

protected $shouldSend