Code Search for Developers
 
 
  

Abstract.php from Astrum Futura at Krugle


Show Abstract.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
 * @subpackage Measure
 * @category   Quantum
 * @copyright  Copyright (c) 2007 The QGL Group (refer to COPYRIGHT file)
 * @version    $Id: Abstract.php 210 2007-02-03 02:55:49Z santosj $
 * @license    http://doc.astrumfutura.com/license.html     New BSD License
 */

/** Quantum_Coordinate */
require_once 'Quantum/Coordinate.php';

/** Quantum_Map_Measure_Exception */
require_once 'Quantum/Map/Measure/Exception.php';

/** Quantum_Coordinate_Exception_InvalidArray */
require_once 'Quantum/Coordinate/Exception/InvalidArray.php';

/**
 * Provides interface for measuring certain unit based measures of a Coordinate
 * Grid for a specific map coordinate array implementation.
 *
 * @package    Map
 * @subpackage Measure
 * @category   Quantum
 * @author     Pádraic Brady (http://blog.astrumfutura.com)
 */
abstract class Quantum_Map_Measure_Abstract
{

    protected function __construct()
    {}

    static public function getInstance()
    {
        throw new Quantum_Map_Measure_Exception('Subclasses of Quantum_Map_Measure_Abstract must be Singletons implementing getInstance().');
    }

    abstract public function getMoveDistance(Quantum_Coordinate_Interface $startNode, Quantum_Coordinate_Interface $endNode);

    abstract public function getUnitDistance(Quantum_Coordinate_Interface $startNode, Quantum_Coordinate_Interface $endNode);

    abstract public function getPerimeterCells(Quantum_Coordinate_Interface $node);

    abstract public function getPerimeterFromRadius($radius);

    abstract public function getAreaFromRadius($radius);

}



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

  Abstract.php
  Exception.php
  Hex.php
  Square.php