当前位置: 首页>>代码示例>>Java>>正文


Java SceneObject类代码示例

本文整理汇总了Java中org.rev317.min.api.wrappers.SceneObject的典型用法代码示例。如果您正苦于以下问题:Java SceneObject类的具体用法?Java SceneObject怎么用?Java SceneObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SceneObject类属于org.rev317.min.api.wrappers包,在下文中一共展示了SceneObject类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: open

import org.rev317.min.api.wrappers.SceneObject; //导入依赖的package包/类
/**
 * Opens bank using banker or bank booth
 *
 * @return <b>true</b> if successfully interacted
 */
public static boolean open() {
    if (isOpen()) {
        return false;
    }

    SceneObject bank   = getBank();
    Npc         banker = getBanker();

    if (bank != null) {
        bank.interact(SceneObjects.Option.USE);
        return true;
    } else if (banker != null) {
        banker.interact(Npcs.Option.BANK);
        return true;
    }

    return false;
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:24,代码来源:Bank.java

示例2: getNearest

import org.rev317.min.api.wrappers.SceneObject; //导入依赖的package包/类
/**
 * Returns nearest objects with given id
 *
 * @param ids
 *
 * @return sceneobjects
 */
public static final SceneObject[] getNearest(final int... ids) {
    return getNearest(new Filter<SceneObject>() {

        @Override
        public boolean accept(SceneObject object) {
            for (final int id : ids) {
                if (id == object.getId()) {
                    return true;
                }
            }

            return false;
        }

    });
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:24,代码来源:SceneObjects.java

示例3: getClosest

import org.rev317.min.api.wrappers.SceneObject; //导入依赖的package包/类
public static final SceneObject getClosest(final int... ids) {
    SceneObject[] nearestObjects = getNearest(new Filter<SceneObject>() {
        @Override
        public boolean accept(SceneObject object) {
            for (final int id : ids) {
                if (id == object.getId()) {
                    return true;
                }
            }

            return false;
        }
    });
    if (nearestObjects == null || nearestObjects.length == 0) {
        return null;
    }

    return nearestObjects[0];
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:20,代码来源:SceneObjects.java

示例4: getSceneObjectAtTile

import org.rev317.min.api.wrappers.SceneObject; //导入依赖的package包/类
private static SceneObject getSceneObjectAtTile(int x, int y) {
    Ground sceneTile = Loader.getClient().getScene().getGroundArray()[Game.getPlane()][x][y];
    if (sceneTile == null) {
        return null;
    }

    final SceneObjectTile[] interactiveObjects = sceneTile.getInteractiveObjects();
    if (interactiveObjects != null) {
        for (final SceneObjectTile interactiveObject : interactiveObjects) {
            if (interactiveObject != null) {
                return new SceneObject(interactiveObject, SceneObject.TYPE_INTERACTIVE);
            }
        }
    }

    SceneObjectTile sceneObjectTile = sceneTile.getWallObject();
    if (sceneObjectTile != null) {
        return new SceneObject(sceneObjectTile, SceneObject.TYPE_WALL);
    }

    return null;
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:23,代码来源:SceneObjects.java

示例5: toggle

import org.rev317.min.api.wrappers.SceneObject; //导入依赖的package包/类
@Override
public void toggle() {
    SceneObject[] objects = SceneObjects.getNearest();
    if (objects == null || objects.length == 0) {
        return;
    }

    for (int i = objects.length - 1; i >= 0; i--) {
        System.out.println(
                " ID: " + objects[i].getId() +
                        " UID: " + objects[i].getHash() +
                        " Location: " + objects[i].getLocation() +
                        " Distance: " + objects[i].distanceTo());
    }
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:16,代码来源:DSceneObjects.java

示例6: getBank

import org.rev317.min.api.wrappers.SceneObject; //导入依赖的package包/类
/**
 * Gets nearest bank booths
 *
 * @return bank booth
 */
public static SceneObject getBank() {
    SceneObject[] banks = getNearestBanks();
    if (banks != null && banks[0] != null) {
        return banks[0];
    }
    return null;
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:13,代码来源:Bank.java

示例7: getSceneObjects

import org.rev317.min.api.wrappers.SceneObject; //导入依赖的package包/类
/**
 * Gets the most important scene objects in game which can be interacted with, filters out: 'walls, wall
 * decorations, ground decorations'
 *
 * @return scene objects
 */
public static final SceneObject[] getSceneObjects(Filter<SceneObject> filter) {
    ArrayList<SceneObject> sceneObjects = new ArrayList<>();
    for (int x = 0; x < 104; x++) {
        for (int y = 0; y < 104; y++) {
            final SceneObject sceneObjectAtTile = getSceneObjectAtTile(x, y);
            if (sceneObjectAtTile != null && filter.accept(sceneObjectAtTile)) {
                sceneObjects.add(sceneObjectAtTile);
            }

        }
    }

    return sceneObjects.toArray(new SceneObject[sceneObjects.size()]);
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:21,代码来源:SceneObjects.java

示例8: getAllSceneObjects

import org.rev317.min.api.wrappers.SceneObject; //导入依赖的package包/类
/**
 * Gets every loaded scene object in game
 *
 * @return every loaded scene object in game
 */
public static final SceneObject[] getAllSceneObjects() {
    ArrayList<SceneObject> sceneObjects = new ArrayList<>();
    for (int x = 0; x < 104; x++) {
        for (int y = 0; y < 104; y++) {
            final Collection<SceneObject> sceneObjectsAtTile = getSceneObjectsAtTile(x, y);
            if (sceneObjectsAtTile != null && !sceneObjectsAtTile.isEmpty()) {
                sceneObjects.addAll(sceneObjectsAtTile);
            }
        }
    }

    return sceneObjects.toArray(new SceneObject[sceneObjects.size()]);
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:19,代码来源:SceneObjects.java

示例9: getSceneObjectsAtTile

import org.rev317.min.api.wrappers.SceneObject; //导入依赖的package包/类
/**
 * Gets all sceneobjects at a tile
 *
 * @param x
 * @param y
 *
 * @return array of sceneobjects, or null if there aren't any
 */
public static final Collection<SceneObject> getSceneObjectsAtTile(int x, int y) {
    Ground                 sceneTile    = Loader.getClient().getScene().getGroundArray()[Game.getPlane()][x][y];
    ArrayList<SceneObject> sceneObjects = null;
    if (sceneTile != null) {
        final SceneObjectTile[] interactiveObjects = sceneTile.getInteractiveObjects();
        if (interactiveObjects != null) {
            for (final SceneObjectTile interactiveObject : interactiveObjects) {
                if (interactiveObject != null) {
                    if (sceneObjects == null) {
                        sceneObjects = new ArrayList<>();
                    }
                    sceneObjects.add(new SceneObject(interactiveObject, SceneObject.TYPE_INTERACTIVE));
                }
            }
        }
        SceneObjectTile sceneObjectTile = sceneTile.getWallObject();
        if (sceneObjectTile != null) {
            if (sceneObjects == null) {
                sceneObjects = new ArrayList<>();
            }
            sceneObjects.add(new SceneObject(sceneObjectTile, SceneObject.TYPE_WALL));
        }

        sceneObjectTile = sceneTile.getWallDecoration();
        if (sceneObjectTile != null) {
            if (sceneObjects == null) {
                sceneObjects = new ArrayList<>();
            }
            sceneObjects.add(new SceneObject(sceneObjectTile, SceneObject.TYPE_WALLDECORATION));
        }

        sceneObjectTile = sceneTile.getGroundDecoration();
        if (sceneObjectTile != null) {
            if (sceneObjects == null) {
                sceneObjects = new ArrayList<>();
            }
            sceneObjects.add(new SceneObject(sceneObjectTile, SceneObject.TYPE_GROUNDDECORATION));
        }

        sceneObjectTile = sceneTile.getGroundItem();
        if (sceneObjectTile != null) {
            if (sceneObjects == null) {
                sceneObjects = new ArrayList<>();
            }
            sceneObjects.add(new SceneObject(sceneObjectTile, SceneObject.TYPE_GROUNDITEM));
        }
    }

    return sceneObjects;
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:59,代码来源:SceneObjects.java

示例10: getNearestBanks

import org.rev317.min.api.wrappers.SceneObject; //导入依赖的package包/类
/**
 * Gets nearest bank booths
 *
 * @return bank booths
 */
public static SceneObject[] getNearestBanks() {
    return SceneObjects.getNearest(BANKS);
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:9,代码来源:Bank.java


注:本文中的org.rev317.min.api.wrappers.SceneObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。