c2ephp

COBAgentBlock Class Reference

COB Agent Block for C1 and C2. More...

Inheritance diagram for COBAgentBlock:
Collaboration diagram for COBAgentBlock:

List of all members.

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...

Detailed Description

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.


Member Function Documentation

COBAgentBlock::AddDependency ( COBDependency dependency)

Adds a dependency to this agent.

Parameters:
$dependencyThe COBDependency to add.

Definition at line 155 of file AgentBlock.php.

COBAgentBlock::AddEventScript ( eventScript)

Adds an event script.

Parameters:
$eventScriptThe 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.

Parameters:
$agentNameThe name of the agent (as displayed in the C2 injector)
$agentDescriptionThe description of the agent (as displayed in the C2 injector)

Definition at line 57 of file AgentBlock.php.

COBBlock::Compile ( ) [abstract, inherited]

Compiles this COB Block and returns COB file as a binary string.

Returns:
string
COBAgentBlock::GetAgentDescription ( )

Gets the agent's description.

Returns:
string

Definition at line 71 of file AgentBlock.php.

COBAgentBlock::GetAgentName ( )

Gets the agent's name.

Returns:
string

Definition at line 65 of file AgentBlock.php.

COBAgentBlock::GetDependencies ( type = null)

Gets dependencies of the given type.

If type is null, will get all dependencies.

Parameters:
$typeOne of the COB_DEPENDENCY_* constants, defined above.
Returns:
An array of COBDependency objects

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.

Parameters:
$whichScriptWhich script to get.
Returns:
A string containing the event script. Each line is seperated by a comma I think.

Definition at line 103 of file AgentBlock.php.

COBAgentBlock::GetEventScriptCount ( )

Gets the number of event scripts.

Returns:
int

Definition at line 89 of file AgentBlock.php.

COBAgentBlock::GetEventScripts ( )

Gets the agent's event scripts.

Returns:
array of strings, each string is an event script

Definition at line 95 of file AgentBlock.php.

COBAgentBlock::GetInstallScript ( )

Gets the agent's install script.

Returns:
string

Definition at line 77 of file AgentBlock.php.

COBAgentBlock::GetRemoveScript ( )

Gets the agent's remove script.

Returns:
string

Definition at line 83 of file AgentBlock.php.

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.

Returns:
int

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.

Returns:
int

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.

Returns:
int

Definition at line 148 of file AgentBlock.php.

COBAgentBlock::GetThumbnail ( )

Gets the thumbnail of this agent as would be shown in the Injector.

Returns:
A SpriteFrame of the thumbnail

Definition at line 109 of file AgentBlock.php.

COBBlock::GetType ( ) [inherited]

Gets the type of this COB block.

Returns:
string One of the COB_BLOCK_* defines.

Definition at line 37 of file COBBlock.php.

COBAgentBlock::SetExpiryDate ( time)

Sets the date this agent will expire.

Parameters:
$timeThe date this agent will expire as a UNIX timestamp

Definition at line 196 of file AgentBlock.php.

COBAgentBlock::SetInstallScript ( installScript)

Sets the install script.

Parameters:
$installScriptthe 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.

Parameters:
$timeThe 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.

Parameters:
$quantityThe quantity available, an integer. 0xFF means infinite.

Definition at line 203 of file AgentBlock.php.

COBAgentBlock::SetRemoveScript ( removeScript)

Sets the remover script.

Parameters:
$removeScriptThe 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.

Parameters:
$reserved1The first reserved variable
$reserved2The second reserved variable
$reserved3The third reserved variable

Definition at line 220 of file AgentBlock.php.

COBAgentBlock::SetReuseInterval ( interval)

Sets the interval required between re-use.

Parameters:
$intervalThe 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.

Parameters:
$frameThe thumbnail as a SpriteFrame

Definition at line 228 of file AgentBlock.php.


Friends And Related Function Documentation

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.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations