Package com.threerings.whirled.spot.data

Examples of com.threerings.whirled.spot.data.Portal


        // place the tile coordinates of our portals into a set for
        // efficient comparison with location coordinates
        _plocs.clear();
        for (Iterator<Portal> iter = _sscene.getPortals(); iter.hasNext(); ) {
            Portal port = iter.next();
            StageLocation loc = (StageLocation) port.loc;
            _plocs.add(new Point(MisoUtil.fullToTile(loc.x),
                                 MisoUtil.fullToTile(loc.y)));
        }
    }
View Full Code Here


        // create scene objects for our portals
        UniformTileSet ots = loadPortalTileSet();

        _portobjs.clear();
        for (Iterator<Portal> iter = _scene.getPortals(); iter.hasNext(); ) {
            Portal portal = iter.next();
            StageLocation loc = (StageLocation) portal.loc;
            Point p = getScreenCoords(loc.x, loc.y);
            int tx = MisoUtil.fullToTile(loc.x);
            int ty = MisoUtil.fullToTile(loc.y);
            Point ts = MisoUtil.tileToScreen(_metrics, tx, ty, new Point());
View Full Code Here

     */
    public Portal getPortal (int fullX, int fullY)
    {
        Iterator<Portal> iter = _scene.getPortals();
        while (iter.hasNext()) {
            Portal portal = iter.next();
            StageLocation loc = (StageLocation) portal.loc;
            if (loc.x == fullX && loc.y == fullY) {
                return portal;
            }
        }
View Full Code Here

                throws Exception
        {
            super.begin(namespace, name, attributes);

            // create the empty Location in the Portal
            Portal p = (Portal) digester.peek();
            p.loc = _ruleset.createLocation();
        }
View Full Code Here

    {
        @Override
        public void begin (String namespace, String name, Attributes attrs)
            throws Exception
        {
            Portal portal = (Portal) digester.peek();
            Class<?> portalClass = portal.getClass();
            Location loc = portal.loc;
            Class<?> locClass = loc.getClass();

            // iterate over the attributes, setting public fields where applicable
            for (int ii = 0; ii < attrs.getLength(); ii++) {
View Full Code Here

            throw new InvocationException(SpotCodes.INTERNAL_ERROR);
        }

        // obtain the destination scene and location id
        SpotScene rss = (SpotScene)srcmgr.getScene();
        Portal dest = rss.getPortal(portalId);

        // give the source scene manager a chance to do access control
        String errmsg = srcmgr.mayTraversePortal(body, dest);
        if (errmsg != null) {
            throw new InvocationException(errmsg);
        }

        // make sure this portal has valid info
        if (dest == null || !dest.isValid()) {
            log.warning("Traverse portal with invalid portal",
                "user", body.who(), "scene", srcmgr.where(), "pid", portalId, "portal", dest,
                "portals", rss.getPortals());
            throw new InvocationException(SpotCodes.NO_SUCH_PORTAL);
        }
View Full Code Here

                "sSceneId", clSceneId, "cSceneId", sceneId);
            return false;
        }

        // find the portal they're talking about
        Portal dest = scene.getPortal(portalId);
        if (dest == null) {
            log.warning("Requested to traverse non-existent portal",
                "portalId", portalId, "portals", scene.getPortals());
            return false;
        }
View Full Code Here

    /**
     * Give our new body a starting location.
     */
    protected void assignStartingLocation (BodyObject body)
    {
        Portal from = _enterers.remove(body.getOid());
        Portal entry;
        if (from != null && from.targetPortalId != -1) {
            entry = _sscene.getPortal(from.targetPortalId);
            if (entry == null) {
                log.warning("Body mapped at invalid portal",
                    "where", where(), "who", body.who(), "from", from);
View Full Code Here

        // select the text edit field
        _portalText.setCaretPosition(0);
        _portalText.moveCaretPosition(text.length());

        // select the default entrance check box appropriately
        Portal entry = _scene.getDefaultEntrance();
        _entrance.setSelected(entry == null ||
                              entry.portalId == _port.portalId);

        // request the keyboard focus so that the destination scene
        // name can be typed immediately
View Full Code Here

    /**
     * Deletes the portal at the specified full coordinates.
     */
    public void deletePortal (int x, int y)
    {
        Portal port = getPortal(x, y);
        if (port != null) {
            _scene.removePortal(port);
            recomputePortals();
            recomputeVisible();
        }
View Full Code Here

TOP

Related Classes of com.threerings.whirled.spot.data.Portal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.