Class: DpDrink
SOURCE LOCATION: /dpuniverse/std/DpDrink.php
Class Overview
|
A common drink which can be turned into beers, wine, etc.
Creates the following DutchPIPE properties:
- boolean isFull - Set to TRUE
- boolean isDrink - Set to TRUE
- boolean isNoSell - Set to TRUE
- string emptyTitle - Title for empty drink
- string emptyTitleDefinite - Definite title for empty drink
- string emptyTitleIndefinite - Indefinite title for empty drink
- string emptyTitleImg - Image for empty drink
- array emptyIds - Id strings for empty drink
- array origIds - Id strings for filled drink
- string origTitle - Title for filled drink
- string origTitleImg - Image for filled drink
- string origBody - Body for filled drink
DpProperties
|
--DpObject
|
--DpDrink
|
METHODS:
|
Methods Summary
| boolean |
actionDrink() |
Makes a living object drink this object |
| void |
createDpDrink() |
Sets this drink object up at the time it is created |
| void |
setFull() |
Fill or empty the drink |
Methods
boolean actionDrink(
string
$verb , string
$noun
)
Makes a living object drink this object
Drinks the drink if $noun is a valid id for this drink and the drink is "full".
| PARAMETERS: |
string |
$verb |
the action, "drink" |
| string |
$noun |
what to drink, could be empty |
| RETURNS: | boolean | TRUE for action completed, FALSE otherwise |
| ACCESS: | public |
void createDpDrink(
)
Sets this drink object up at the time it is created
An empty function which can be redefined by the drink object extending on DpDrink. When the object is created, it has no title, HTML body, et cetera, so in this method methods like DpObject::setTitle() are called.
void resetDpDrink(
)
Resets this drink object
Called by this drink object at regular intervals as defined in dpuniverse-ini.php. An empty function which can be redefined by the drink object extending on DpDrink. To be used to periodically do stuff such as alter the state of the drink object.
void setFull(
[string
$isFull = TRUE]
)
Fill or empty the drink
Adjusts the drink's appearance and behaviour. Without an argument, fills the drink. Drink objects are filled by default after being created. Drink objects which are filled have the property "isFull" set to TRUE in them.
| PARAMETERS: |
string |
$isFull |
TRUE to fill, FALSE to empty drink |
| ACCESS: | public |
|
|