Package com.threerings.stage.data

Examples of com.threerings.stage.data.StageLocation


        try {
            SceneParser parser = new SceneParser("scene");
            parser.registerAuxRuleSet(new SpotSceneRuleSet() {
                @Override
                protected Location createLocation () {
                    return new StageLocation(); // breaks package, but ok
                }
            });
            String tspath = TestUtil.getResourcePath(TEST_SCENE_PATH);
            SceneModel scene = parser.parseScene(tspath);
            System.out.println("Parsed " + scene + ".");
View Full Code Here


        // add rule sets for our aux scene models
        registerAuxRuleSet(new SpotSceneRuleSet() {
            @Override
            protected Location createLocation () {
                return new StageLocation();
            }
        });
        registerAuxRuleSet(new StageMisoSceneRuleSet());
    }
View Full Code Here

        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

                Controller.postAction(this, CLUSTER_CLICKED, actarg);
            } else {
                // post an action indicating that we've clicked on a location
                Point lc = MisoUtil.screenToFull(_metrics, event.getX(), event.getY(), new Point());
                Controller.postAction(this, LOCATION_CLICKED,
                                      new StageLocation(lc.x, lc.y, (byte)0));
            }
            return true;
        }
        return false;
    }
View Full Code Here

    {
        // compute a screen rectangle that contains all possible "spots" in this cluster
        List<SceneLocation> spots = StageSceneUtil.getClusterLocs(cluster);
        Rectangle cbounds = null;
        for (int ii = 0, ll = spots.size(); ii < ll; ii++) {
            StageLocation loc = ((StageLocation) spots.get(ii).loc);
            Point sp = getScreenCoords(loc.x, loc.y);
            if (cbounds == null) {
                cbounds = new Rectangle(sp.x, sp.y, 0, 0);
            } else {
                cbounds.add(sp.x, sp.y);
View Full Code Here

            public boolean canTraverse (Object traverser, int x, int y) {
                _tloc.x = MisoUtil.toFull(x, 2);
                _tloc.y = MisoUtil.toFull(y, 2);
                return mayStandAtLocation((BodyObject)traverser, _tloc);
            }
            protected StageLocation _tloc = new StageLocation();
        };
    }
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;
            }
        }
        return null;
View Full Code Here

    protected void updateLocation (BodyObject source, Location loc)
    {
        super.updateLocation(source, loc);

        // keep a rectangle around for each un-clustered occupant
        StageLocation sloc = (StageLocation) loc;
        int tx = MisoUtil.fullToTile(sloc.x), ty = MisoUtil.fullToTile(sloc.y);
        _loners.put(source.getOid(), new Rectangle(tx, ty, 1, 1));
    }
View Full Code Here

        // 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

        }

        // if they are already standing on this tile, allow it
        SceneLocation cloc = _ssobj.occupantLocs.get(Integer.valueOf(source.getOid()));
        if (cloc != null) {
            StageLocation sloc = (StageLocation) cloc.loc;
            if (MisoUtil.fullToTile(sloc.x) == tx &&
                    MisoUtil.fullToTile(sloc.y) == ty) {
//                Log.info("Allowing adjust [who=" + source.who () +
//                    ", cloc=" + cloc + ", nloc=" + loc + "].");
                return true;
View Full Code Here

TOP

Related Classes of com.threerings.stage.data.StageLocation

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.