c2ephp
|
COB Agent Block for C1 and C2. More...
Public Member Functions | |
COBAgentBlock ($agentName, $agentDescription) | |
Initialises a new COBAgentBlock with the given name and description. | |
GetAgentName () | |
Gets the agent's name. | |
GetAgentDescription () | |
Gets the agent's description. | |
GetInstallScript () | |
Gets the agent's install script. | |
GetRemoveScript () | |
Gets the agent's remove script. | |
GetEventScriptCount () | |
Gets the number of event scripts. | |
GetEventScripts () | |
Gets the agent's event scripts. | |
GetEventScript ($whichScript) | |
Gets an event script. | |
GetThumbnail () | |
Gets the thumbnail of this agent as would be shown in the Injector. | |
GetDependencies ($type=null) | |
Gets dependencies of the given type. | |
GetReserved1 () | |
Gets the value of reserved1. | |
GetReserved2 () | |
Gets the value of reserved2. | |
GetReserved3 () | |
Gets the value of reserved3. | |
AddDependency (COBDependency $dependency) | |
Adds a dependency to this agent. | |
SetInstallScript ($installScript) | |
Sets the install script. | |
SetRemoveScript ($removeScript) | |
Sets the remover script. | |
AddEventScript ($eventScript) | |
Adds an event script. | |
SetLastUsageDate ($time) | |
Sets the date this agent was last injected. | |
SetExpiryDate ($time) | |
Sets the date this agent will expire. | |
SetQuantityAvailable ($quantity) | |
Sets the quantity of the agent available. | |
SetReuseInterval ($interval) | |
Sets the interval required between re-use. | |
SetReserved ($reserved1, $reserved2, $reserved3) | |
Adds the reserved variables to this agent. | |
SetThumbnail (SpriteFrame $frame) | |
Add the thumbnail to this agent. | |
GetType () | |
Gets the type of this COB block. | |
Compile () | |
Compiles this COB Block and returns COB file as a binary string. | |
Related Functions | |
(Note that these are not member functions.) | |
Dependency Types | |
The two types of dependency available to C1/C2 COBs | |
enum | DEPENDENCY_SPRITE |
enum | DEPENDENCY_SOUND |
Cob Block Types | |
enum | COB_BLOCK_AGENT |
Agent Block - 'agnt'. More... | |
enum | COB_BLOCK_FILE |
File Block - 'file'. More... | |
enum | COB_BLOCK_AUTHOR |
Author Block - 'auth'. More... |
COB Agent Block for C1 and C2.
For Creatures 1, this block contains all the useful data in a typical COB and will be the only block.
For Creatures 2, this block contains the scripts and metadata about the actual object.
Definition at line 26 of file AgentBlock.php.
COBAgentBlock::AddDependency | ( | COBDependency $ | dependency | ) |
Adds a dependency to this agent.
$dependency | The COBDependency to add. |
Definition at line 155 of file AgentBlock.php.
COBAgentBlock::AddEventScript | ( | $ | eventScript | ) |
Adds an event script.
$eventScript | The text of the script to add |
Definition at line 178 of file AgentBlock.php.
COBAgentBlock::COBAgentBlock | ( | $ | agentName, |
$ | agentDescription | ||
) |
Initialises a new COBAgentBlock with the given name and description.
As defaults can be made for everything else these are the only non-optional parts of a COB file in my opinion. Even then they could just be '' if you really felt like it.
$agentName | The name of the agent (as displayed in the C2 injector) |
$agentDescription | The description of the agent (as displayed in the C2 injector) |
Definition at line 57 of file AgentBlock.php.
COBBlock::Compile | ( | ) | [abstract, inherited] |
COBAgentBlock::GetAgentDescription | ( | ) |
COBAgentBlock::GetAgentName | ( | ) |
COBAgentBlock::GetDependencies | ( | $ | type = null | ) |
Gets dependencies of the given type.
If type is null, will get all dependencies.
$type | One of the COB_DEPENDENCY_* constants, defined above. |
Definition at line 118 of file AgentBlock.php.
COBAgentBlock::GetEventScript | ( | $ | whichScript | ) |
Gets an event script.
Event scripts are not necessarily in any order, so you have to work out what each script is for yourself.
$whichScript | Which script to get. |
Definition at line 103 of file AgentBlock.php.
COBAgentBlock::GetEventScriptCount | ( | ) |
COBAgentBlock::GetEventScripts | ( | ) |
Gets the agent's event scripts.
Definition at line 95 of file AgentBlock.php.
COBAgentBlock::GetInstallScript | ( | ) |
COBAgentBlock::GetRemoveScript | ( | ) |
COBAgentBlock::GetReserved1 | ( | ) |
Gets the value of reserved1.
Reserved values weren't ever officially used by CL, but someone might find them useful for something else.
Definition at line 132 of file AgentBlock.php.
COBAgentBlock::GetReserved2 | ( | ) |
Gets the value of reserved2.
Reserved values weren't ever officially used by CL, but someone might find them useful for something else.
Definition at line 140 of file AgentBlock.php.
COBAgentBlock::GetReserved3 | ( | ) |
Gets the value of reserved3.
Reserved values weren't ever officially used by CL, but someone might find them useful for something else.
Definition at line 148 of file AgentBlock.php.
COBAgentBlock::GetThumbnail | ( | ) |
Gets the thumbnail of this agent as would be shown in the Injector.
Definition at line 109 of file AgentBlock.php.
COBBlock::GetType | ( | ) | [inherited] |
Gets the type of this COB block.
Definition at line 37 of file COBBlock.php.
COBAgentBlock::SetExpiryDate | ( | $ | time | ) |
Sets the date this agent will expire.
$time | The date this agent will expire as a UNIX timestamp |
Definition at line 196 of file AgentBlock.php.
COBAgentBlock::SetInstallScript | ( | $ | installScript | ) |
Sets the install script.
$installScript | the text of the script to add |
Definition at line 164 of file AgentBlock.php.
COBAgentBlock::SetLastUsageDate | ( | $ | time | ) |
Sets the date this agent was last injected.
$time | The date this agent was last injected as a UNIX timestamp |
Definition at line 185 of file AgentBlock.php.
COBAgentBlock::SetQuantityAvailable | ( | $ | quantity | ) |
Sets the quantity of the agent available.
$quantity | The quantity available, an integer. 0xFF means infinite. |
Definition at line 203 of file AgentBlock.php.
COBAgentBlock::SetRemoveScript | ( | $ | removeScript | ) |
Sets the remover script.
$removeScript | The text of the script to add |
Definition at line 171 of file AgentBlock.php.
COBAgentBlock::SetReserved | ( | $ | reserved1, |
$ | reserved2, | ||
$ | reserved3 | ||
) |
Adds the reserved variables to this agent.
These variables have no meaning to Creatures 2 and don't appear in Creatures 1. They're all integers.
$reserved1 | The first reserved variable |
$reserved2 | The second reserved variable |
$reserved3 | The third reserved variable |
Definition at line 220 of file AgentBlock.php.
COBAgentBlock::SetReuseInterval | ( | $ | interval | ) |
Sets the interval required between re-use.
$interval | The interval in seconds, between re-use of this agent. |
Definition at line 209 of file AgentBlock.php.
COBAgentBlock::SetThumbnail | ( | SpriteFrame $ | frame | ) |
Add the thumbnail to this agent.
$frame | The thumbnail as a SpriteFrame |
Definition at line 228 of file AgentBlock.php.
enum COB_BLOCK_AGENT [related, inherited] |
Agent Block - 'agnt'.
Definition at line 8 of file COBBlock.php.
enum COB_BLOCK_AUTHOR [related, inherited] |
Author Block - 'auth'.
Definition at line 12 of file COBBlock.php.
enum COB_BLOCK_FILE [related, inherited] |
File Block - 'file'.
Definition at line 10 of file COBBlock.php.
enum DEPENDENCY_SOUND [related] |
Sound dependency - 'sound'
Definition at line 17 of file AgentBlock.php.
enum DEPENDENCY_SPRITE [related] |
Sprite dependency - 'sprite'
Definition at line 15 of file AgentBlock.php.