Package com.threerings.miso.client

Examples of com.threerings.miso.client.SceneBlock


    public boolean setBaseTile (int fqTileId, int x, int y)
    {
        if (!_model.setBaseTile(fqTileId, x, y)) {
            return false;
        }
        SceneBlock block = getBlock(x, y);
        if (block != null && block.isResolved()) {
            block.updateBaseTile(fqTileId, x, y);
        }

        // and recompute any surrounding fringe
        for (int fx = x - 1, xn = x + 1; fx <= xn; fx++) {
            for (int fy = y - 1, yn = y + 1; fy <= yn; fy++) {
                block = getBlock(fx, fy);
                if (block != null && block.isResolved()) {
                    block.updateFringe(fx, fy);
                }
            }
        }
        return true;
    }
View Full Code Here


    public ObjectInfo addObject (ObjectInfo oinfo)
    {
        // first attempt to add it to the appropriate scene block; this
        // will fail if there's already a copy of the same object at this
        // coordinate
        SceneBlock block = getBlock(oinfo.x, oinfo.y);
        if (block== null || !block.isResolved() || block.addObject(oinfo)) {
            // create an object info and add it to the scene model
            if (_model.addObject(oinfo)) {
                // recompute our visible object set
                recomputeVisible();
                return oinfo;
View Full Code Here

    public boolean deleteObject (ObjectInfo info)
    {
        // remove it from the scene model
        if (_model.removeObject(info)) {
            // clear the object out of its block
            SceneBlock block = getBlock(info.x, info.y);
            if (block != null && block.isResolved()) {
                block.deleteObject(info);
            }

            // recompute our visible object set
            recomputeVisible();
            return true;
View Full Code Here

TOP

Related Classes of com.threerings.miso.client.SceneBlock

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.