Location: PHPKode > projects > PhpBlock > A9.8/modules/default/objectmanager.class.php
<?php
include_once $PATH_TO_CODE."/script/abstractobjectmanager.class.php";
include_once $PATH_TO_CODE."/script/zone.class.php";
include_once $PATH_TO_CODE."/script/block.class.php";
include_once $PATH_TO_CODE."/script/realobject.class.php";
include_once $PATH_TO_CODE."/script/weapon.class.php";

class ObjectManager extends AbstractObjectManager
{
    function getInstance()
    {
        if(!AbstractObjectManager::$instance) {
            AbstractObjectManager::$instance = new ObjectManager();
        }
        return ObjectManager::$instance;
    }

    protected function __construct()
    {
        parent::__construct();
    }

    public function createNewPlayer($parPlayerName, $parEntityNameLogin, $parPlayerLogin, $parPlayerPassword, $parColor) {
        Player::create($parPlayerName, $parEntityNameLogin, $parPlayerLogin, $parPlayerPassword, $parColor);
    }

    public function __destruct()
    {
        Log::debug("ObjectManager __destruct");
    }

    public function createBlock($parBlockId) {
        return new Block($parBlockId);
    }
    public function createZone($parZoneId) {
        return new Zone($parZoneId);
    }
    public function createPlayer($parPlayerId) {
        return new Player($parPlayerId);
    }
    public function createWeapon($parObject, $parWeaponNum, $parWeaponType, $parTargetId, $parAimPercentFire, $parAccurency, $parShootingRange, $parDamage) {
        return new Weapon($parObject, $parWeaponNum, $parTargetId, $parAimPercentFire, $parAccurency, $parShootingRange, $parDamage);
    }
    public function createRealObject($parObjectId, $parObjectInfo) {
        return new RealObject($parObjectInfo);
    }
}
$gloObjectManager = ObjectManager::getInstance();

?>
Return current item: PhpBlock