Esempio n. 1
0
 /**
  * Map constructor.
  * @param $file string|MPQFile the map file name or MPQFile instance
  * @throws MapException if the file given is not a string or a mpq file
  */
 public function __construct($file)
 {
     if (is_string($file)) {
         $file = MPQFile::parseFile($file);
     }
     if (!$file instanceof MPQFile) {
         throw new MapException("Invalid map file given");
     }
     $this->file = $file;
     $this->file->parse();
 }
Esempio n. 2
0
 private function parseAttributeMap()
 {
     $this->file->parse();
     $stream = $this->file->openStream('replay.attributes.events');
     return new AttributeMap($stream);
 }