Show Map.php syntax highlighted
<?php
/**
* @internal
* Quantum Game Library
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the text file LICENSE located in the root
* directory of this library.
* It is also available through the internet at this URL:
* http://doc.astrumfutura.com/license.html
*
* If you did not receive a copy of the license and are unable to
* obtain it through the internet, please send an email
* to license@astrumfutura.com so we can send you a copy.
*
* @package Map
* @category Quantum
* @copyright Copyright (c) 2007 The QGL Group (refer to COPYRIGHT file)
* @version $Id: Map.php 210 2007-02-03 02:55:49Z santosj $
* @license http://doc.astrumfutura.com/license.html New BSD License
*/
/**
* @package Map
* @category Quantum
* @author Pádraic Brady (http://blog.astrumfutura.com)
*/
class Quantum_Map
{
protected $grid = null;
protected $gridArray = null;
protected $options = array(
'height'=>100,
'width'=>100
);
public function __construct()
{
}
public function map()
{
$this->grid = new Quantum_Map_Grid_Hex(
$this->options['height']*$this->options['width']
);
$this->gridArray = $this->grid->generate();
}
public function __get($key)
{
if(isset($this->options[$key]))
{
return $this->options[$key];
}
return null;
}
protected function __set($key, $val)
{
if(array_key_exists($key, $this->options))
{
$this->options[$key] = $val;
}
}
protected function __isset($name)
{
return isset($this->options[$name]);
}
protected function __unset($name)
{
unset($this->options[$name]);
}
public function getGrid()
{
return $this->grid->getGrid();
}
}
See more files for this project here