Code Search for Developers
 
 
  

Method.php from Astrum Futura at Krugle


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

/* Quantum_State_Action_Interface */
require_once 'Quantum/State/Action/Interface.php';

/**
 * The Method Action class saves the existing method to be executed later.
 * 
 * The method must be public and must not be static. All of the logic must also
 * exist in that method or at least must depend on the constructor for those 
 * properties.
 *
 * @package    State
 * @subpackage Action
 * @category   AI
 * @author     Jacob Santos (http://www.santosj.name)
 */
class Quantum_State_Action_Method
{
    private $classname = null;
    private $method = null;
    
    public function __construct($classname, $method)
    {
        if(class_exists($classname, false) === true)
        {
            $object = new $classname; // Possible Bug
            if(method_exists($object, $method))
            {
                $this->classname = $classname;
                $this->method = $method;
            }
        }
    }
    
    public function execute()
    {
        // Possible bug
        //$classname = $this->classname; // Possible Fix to Possible first bug
        $object = new $this->classname;
        
        call_user_method($this->method, $object);
    }
}



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

  Function.php
  Interface.php
  Method.php