Class: DpHeap
SOURCE LOCATION: /dpuniverse/std/DpHeap.php
Class Overview
|
A heap of credits, stones, etc., represented by one object
When instances of these objects get the same environment, they will merge. Creates the following DutchPIPE properties:
- int amount - Number of units in heap
- string isHeap - Set to TRUE
- string heapTitleSingular - Title for single unit
- string heapTitlePlural - Title for more units
- int|float heapWeightModifier - Weight increase per unit
- int|float heapVolumeModifier - Volume increase per unit
- int|float heapValueModifier - Value increase per unit
DpProperties
|
--DpObject
|
--DpHeap
|
METHODS:
|
Direct Descendants
| Credits |
Credits object for monetary system
|
Methods Summary
| void |
createDpHeap() |
Sets this heap object up at the time it is created |
| boolean |
isId() |
Checks if the given id is a valid id for this object |
| int |
moveDpObject() |
Moves this object into the inventory of another object |
| bool |
setAmount() |
Sets the amount of items in the heap |
Methods
void createDpHeap(
)
Sets this heap object up at the time it is created
An empty function which can be redefined by the heap object extending on DpHeap.
boolean isId(
string
$id , [string
$checkWithArticle = TRUE]
)
Checks if the given id is a valid id for this object
| PARAMETERS: |
string |
$id |
name string to check |
| string |
$checkWithArticle |
also check ids with articles |
| RETURNS: | boolean | TRUE if the id is valid, FALSE otherwise |
| SEE: | DpObject::isId() |
| REDEFINITION OF: |
DpObject::isId(): Checks if the given id is a valid id for this object |
int moveDpObject(
mixed
&$target_ob , [boolean
$simple = FALSE] , [
$heap_amount = FALSE]
)
Moves this object into the inventory of another object
| PARAMETERS: |
mixed |
&$target_ob |
path or object to move into to |
| boolean |
$simple |
skip some checks |
| |
$heap_amount |
|
| RETURNS: | int | TRUE for success, an error code for failure |
| REDEFINITION OF: |
DpObject::moveDpObject(): Moves this object into the inventory of another object |
void resetDpHeap(
)
Resets this heap object
Called by this heap object at regular intervals as defined in dpuniverse-ini.php. An empty function which can be redefined by the heap object extending on DpDrink. To be used to periodically do stuff such as alter the state of the heap object.
bool setAmount(
string
$amount
)
Sets the amount of items in the heap
| PARAMETERS: |
string |
$amount |
new number of items in the heap |
| RETURNS: | bool | TRUE for success, FALSE for failure |
| ACCESS: | protected |
|
|