c2ephp

agents/PRAY/CreaturesArchiveBlock.php

Go to the documentation of this file.
00001 <?php
00002 
00003 require_once(dirname(__FILE__).'/CreaturesArchiveBlock.php');
00004 require_once(dirname(__FILE__).'/PrayBlock.php');
00006 
00009 abstract class CreaturesArchiveBlock extends PrayBlock {
00011 
00013 
00020     public function CreaturesArchiveBlock(&$prayfile,$name,$content,$flags,$type) {
00021         parent::PrayBlock($prayfile,$name,$content,$flags,$type);
00022         if($prayfile instanceof PRAYFile) {
00023             if(!$this->DeArchive()) {
00024                 throw new Exception('De-Archiving failed, block probably wasn\'t a CreaturesArchive type');
00025             }
00026         }
00027     }
00029 
00031     private function DeArchive() {
00032         $content = $this->GetData();
00033         if($content{0} == 'C') {
00034             $content = DeArchive($content);
00035             if($content !== false) {
00036                 $this->SetData($content);
00037                 return true;
00038             }
00039 //          echo 'Invalid CreaturesArchive';
00040             return false;
00041         }
00042         return true;
00043     }
00044 
00045 }
00046 ?>
 All Classes Files Functions Variables Enumerations