Code Search for Developers
 
 
  

Map.php from Astrum Futura at Krugle


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

Astrum Futura

Multiplayer space strategy game written in PHP5 with the Zend Framework. User interface uses Javascript/AJAX for dynamic interaction. Players compete across a hexagonal map of 10,000 sectors, planets, stars and other locations through trade and combat.

Project homepage: http://sourceforge.net/projects/astrumfutura
Programming language(s): PHP,XML
License: other

  Coordinate/
    Array/
      Interface.php
    Boundary/
      Abstract.php
      Auto.php
      Exception.php
      Manual.php
    Exception/
      InvalidArray.php
      InvalidIndex.php
      InvalidX.php
      InvalidY.php
      InvalidZ.php
      RemovalFailure.php
    Node/
      Blocked.php
      End.php
      Impassable.php
      Interface.php
      Open.php
      Passable.php
      Planet.php
      Star.php
      Start.php
    Array.php
    Boundary.php
    Exception.php
    Index.php
    Interface.php
  Db/
    Access/
      Exception.php
      Interface.php
    Driver/
      Pdo/
        Abstract.php
        Mysql.php
      Exception.php
      Interface.php
    Schema/
      Exception.php
      Xml.php
    Access.php
    Db.php
    Exception.php
    NamedQueries.php
    NamedQueries.xml
    Row.php
  Map/
    Grid/
      Abstract.php
      Exception.php
      Hex.php
      Square.php
    Measure/
      Abstract.php
      Exception.php
      Hex.php
      Square.php
    Placement/
      Interface.php
    Star/
      Generate/
        Interface.php
        Simple.php
      Position/
        Interface.php
        Random.php
    Exception.php
  State/
    Action/
      Function.php
      Interface.php
      Method.php
    Condition/
      Boolean.php
      Contains.php
      Equality.php
      Greater.php
      Interface.php
      Less.php
      Range.php
    Abstract.php
    Condition.php
    Exception.php
    Transition.php
  Turing/
    Exception.php
    Interface.php
    Math.php
  Coordinate.php
  Db.php
  Exception.php
  Map.php
  State.php