c2ephp

GLSTBlock Class Reference

PRAY Block for Creature History Data. More...

Inheritance diagram for GLSTBlock:
Collaboration diagram for GLSTBlock:

List of all members.

Public Member Functions

 GLSTBlock ($object, $name, $content, $flags)
 Creates a new GLSTBlock.
 GetHistory ()
 Gets the CreatureHistory this block stores.
 GetPHOTBlockName (CreatureHistoryEvent $event)
 Gets the name of the PHOTBlock corresponding to the event given.
 GetPhotoBlock (CreatureHistoryEvent $event)
 Gets a PHOTBlock corresponding to the given CreatureHistoryEvent.
 GetName ()
 Gets the PRAY block's name.
 GetData ()
 Gets the PRAY block's binary data if the PRAYBlock is decompiled.
 GetType ()
 Gets the type of PrayBlock this is.
 GetFlags ()
 Returns the flag bitfield used to determine flags.
 IsFlagSet ($flag)
 Tells you whether $flag is set on this PRAY block.
 Compile ()
 Compile this PrayBlock.

Private Member Functions

 GuessFormat ()
 Tries to work out which game this GLSTBlock is from.

Related Functions

(Note that these are not member functions.)
History Formats
enum  GLST_FORMAT_UNKNOWN
enum  GLST_FORMAT_C3
enum  GLST_FORMAT_DS
Block Types

Constants for the various PRAY block types

enum  PRAY_BLOCK_AGNT
enum  PRAY_BLOCK_CREA
enum  PRAY_BLOCK_DFAM
enum  PRAY_BLOCK_DSAG
enum  PRAY_BLOCK_DSEX
enum  PRAY_BLOCK_EGGS
enum  PRAY_BLOCK_EXPC
enum  PRAY_BLOCK_FILE
enum  PRAY_BLOCK_GENE
enum  PRAY_BLOCK_GLST
enum  PRAY_BLOCK_LIVE
enum  PRAY_BLOCK_PHOT
enum  PRAY_BLOCK_SFAM
Flags

Flags used to specify how the block's data is stored.

enum  PRAY_FLAG_ZLIB_COMPRESSED
 

Whether or not the block is zLib compressed.

More...

Detailed Description

PRAY Block for Creature History Data.

Definition at line 21 of file GLSTBlock.php.


Member Function Documentation

PrayBlock::Compile ( ) [inherited]

Compile this PrayBlock.

Compiles the PrayBlock's data if necessary, then adds the header and returns the binary pray block.
This function is mainly intended for use by PRAYFiles.

Reimplemented in BinaryBlock.

Definition at line 253 of file PrayBlock.php.

PrayBlock::GetData ( ) [inherited]

Gets the PRAY block's binary data if the PRAYBlock is decompiled.

It will decompress automatically if necessary, then unset the compressed flag. TODO: I'm not 100% sure I should keep this public... return the PRAY block's binary data.

Definition at line 153 of file PrayBlock.php.

PrayBlock::GetFlags ( ) [inherited]

Returns the flag bitfield used to determine flags.

Prefer using IsFlagSet. (This may be deprecated/removed in future releases) Least Significant Bit determines whether the block is compressed (1) or not. All other bits are 0 in all c2e-compatible PRAY blocks.

Returns:
an integer 0-255

Definition at line 179 of file PrayBlock.php.

GLSTBlock::GetHistory ( )

Gets the CreatureHistory this block stores.

Definition at line 76 of file GLSTBlock.php.

PrayBlock::GetName ( ) [inherited]

Gets the PRAY block's name.

return the PRAY block's name

Definition at line 144 of file PrayBlock.php.

GLSTBlock::GetPHOTBlockName ( CreatureHistoryEvent event)

Gets the name of the PHOTBlock corresponding to the event given.

Useful for getting a photo-taken event's photo.
e.g. if $block is a GLSTBlock, $prayfile a PRAYFile, and $event a CreatureHistoryEvent for an event with a photo, one can use this function thusly:

$photblock = $prayfile->GetBlockByName($block->GetPHOTBlockName($event))
 $photo = $photblock->GetS16File();

$photo is now an S16File ready for use.

Definition at line 92 of file GLSTBlock.php.

GLSTBlock::GetPhotoBlock ( CreatureHistoryEvent event)

Gets a PHOTBlock corresponding to the given CreatureHistoryEvent.

This only works in a GLSTBlock that has been read from a PRAYFile - and even then it may throw exceptions. Be cautious and handle errors.

Definition at line 111 of file GLSTBlock.php.

PrayBlock::GetType ( ) [inherited]

Gets the type of PrayBlock this is.

Gives the type as one of the PRAY_BLOCK_* constants - a four-character string, all in caps. These are defined above.

Returns:
One of the PRAY_BLOCK_* constants

Definition at line 170 of file PrayBlock.php.

GLSTBlock::GLSTBlock ( object,
name,
content,
flags 
)

Creates a new GLSTBlock.

If $prayfile is not null, all the data for this block will be read from the PRAYFile.

Parameters:
$objectThe PRAYFile this FILEBlock belongs to, or the CreatureHistory object to store. Cannot be null.
$nameThe name of this block. I think it's usually the creature's moniker with .GLST appended.
$contentThe binary data of this file block.
$flagsThe block's flags. See PrayBlock.

Definition at line 41 of file GLSTBlock.php.

GLSTBlock::GuessFormat ( ) [private]

Tries to work out which game this GLSTBlock is from.

Definition at line 53 of file GLSTBlock.php.

PrayBlock::IsFlagSet ( flag) [inherited]

Tells you whether $flag is set on this PRAY block.

Parameters:
$flagthe bitfield to compare $flags to. As such can be multiple flags OR'd together.
Returns:
true or false.

Definition at line 187 of file PrayBlock.php.


Friends And Related Function Documentation

enum GLST_FORMAT_C3 [related]

Value: 1

Definition at line 15 of file GLSTBlock.php.

enum GLST_FORMAT_DS [related]

Value: 2

Definition at line 17 of file GLSTBlock.php.

enum GLST_FORMAT_UNKNOWN [related]

Value: 0

Definition at line 13 of file GLSTBlock.php.

enum PRAY_BLOCK_AGNT [related, inherited]

Value: 'AGNT'

Definition at line 27 of file PrayBlock.php.

enum PRAY_BLOCK_CREA [related, inherited]

Value: 'CREA'

Definition at line 29 of file PrayBlock.php.

enum PRAY_BLOCK_DFAM [related, inherited]

Value: 'DFAM'

Definition at line 31 of file PrayBlock.php.

enum PRAY_BLOCK_DSAG [related, inherited]

Value: 'DSAG'

Definition at line 33 of file PrayBlock.php.

enum PRAY_BLOCK_DSEX [related, inherited]

Value: 'DSEX'

Definition at line 35 of file PrayBlock.php.

enum PRAY_BLOCK_EGGS [related, inherited]

Value: 'EGG'

Definition at line 37 of file PrayBlock.php.

enum PRAY_BLOCK_EXPC [related, inherited]

Value: 'EXPC'

Definition at line 39 of file PrayBlock.php.

enum PRAY_BLOCK_FILE [related, inherited]

Value: 'FILE'

Definition at line 41 of file PrayBlock.php.

enum PRAY_BLOCK_GENE [related, inherited]

Value: 'GENE'

Definition at line 43 of file PrayBlock.php.

enum PRAY_BLOCK_GLST [related, inherited]

Value: 'GLST'

Definition at line 45 of file PrayBlock.php.

enum PRAY_BLOCK_LIVE [related, inherited]

Value: 'LIVE'

Definition at line 47 of file PrayBlock.php.

enum PRAY_BLOCK_PHOT [related, inherited]

Value: 'PHOT'

Definition at line 49 of file PrayBlock.php.

enum PRAY_BLOCK_SFAM [related, inherited]

Value: 'SFAM'

Definition at line 51 of file PrayBlock.php.

enum PRAY_FLAG_ZLIB_COMPRESSED [related, inherited]

Whether or not the block is zLib compressed.

Value: 1

Definition at line 60 of file PrayBlock.php.


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