當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。