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


Java Interface类代码示例

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


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

示例1: getCount

import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
 * Gets the amount of items in inventory
 *
 * @param includeStack - true for including stack sizes to the counting
 *
 * @return amount of items
 */
public static int getCount(final boolean includeStack) {
    final Interface inventory = getInterface();
    if (inventory == null) {
        return -1;
    }
    int         count      = 0;
    final int[] items      = inventory.getItems();
    final int[] stackSizes = includeStack ? inventory.getStackSizes() : null;
    for (int i = 0; i < items.length; i++) {
        if (items[i] > 0) {
            count += includeStack ? stackSizes[i] : 1;
        }
    }
    return count;
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:23,代码来源:Inventory.java

示例2: getItems

import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
 * Gets all items accepted by filter
 *
 * @param filter
 *
 * @return items
 */
public static Item[] getItems(final Filter<Item> filter) {
    final Interface inventory = getInterface();
    if (inventory == null) {
        return null;
    }
    final int[]           items      = inventory.getItems();
    final int[]           stackSizes = inventory.getStackSizes();
    final ArrayList<Item> invItems   = new ArrayList<>(28);
    for (int i = 0; i < items.length; i++) {
        final int itemId = items[i];
        if (itemId < 1) {
            continue;
        }
        final int  stackSize = stackSizes[i];
        final Item item      = new Item(itemId, stackSize, i);
        if (filter.accept(item)) {
            invItems.add(item);
        }
    }
    return invItems.toArray(new Item[invItems.size()]);
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:29,代码来源:Inventory.java

示例3: getItemIDs

import org.rev317.min.accessors.Interface; //导入依赖的package包/类
private static int[] getItemIDs(int interfaceID) {
    Interface i;
    if ((i = Interfaces.getInterfaces()[interfaceID]) != null) {
        int[] items;
        if ((items = i.getItems()) != null && items.length > 0) {
            return items;
        }
    }
    return new int[0];
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:11,代码来源:Trading.java

示例4: getItemStacks

import org.rev317.min.accessors.Interface; //导入依赖的package包/类
private static int[] getItemStacks(int interfaceID) {
    Interface i;

    if ((i = Interfaces.getInterfaces()[interfaceID]) != null) {
        int[] stacks;
        if ((stacks = i.getStackSizes()) != null && stacks.length > 0) {
            return stacks;
        }
    }
    return new int[0];
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:12,代码来源:Trading.java

示例5: getInterfaces

import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
 * Get's the interfaces loaded in the interface Cache.
 *
 * @return Interfaces in the Interface Cache.
 */
public static Interface[] getInterfaces() {
    return Loader.getClient().getInterfaceCache();
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:9,代码来源:Interfaces.java

示例6: getInterface

import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
 * Get's the Interface from the Interface Cache using the given ID.
 *
 * @param id Interface ID.
 *
 * @return Interface from the cache by the given ID.
 */
public static Interface getInterface(int id) {
    return getInterfaces()[id];
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:11,代码来源:Interfaces.java

示例7: getInterface

import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
 * Gets inventory interface
 *
 * @return interface of inventory
 */
public static Interface getInterface() {
    return Loader.getClient().getInterfaceCache()[settings.get("inventory_index")];
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-PkHonor,代码行数:9,代码来源:Inventory.java

示例8: getInterface

import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
 * Gets inventory interface
 *
 * @return interface of inventory
 */
public static Interface getInterface() {
    return Loader.getClient().getInterfaceCache()[Settings.getActionByName("inventory_index")];
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified,代码行数:9,代码来源:Inventory.java


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