StatDescriptor[] stats = resourceInstTable[resourceInstId].getType().getStats(); for (int i=0; i < stats.length; i++) { long v;
StatDescriptor[] stats = resourceInstTable[resourceInstId].getType().getStats(); for (int i=0; i < stats.length; i++) { long v;
System.out.print(" instId=" + resourceInstId); StatDescriptor[] stats = resourceInstTable[resourceInstId].getType().getStats(); int statOffset = dataIn.readUnsignedByte(); while (statOffset != ILLEGAL_STAT_OFFSET) {
System.out.print(" instId=" + resourceInstId); StatDescriptor[] stats = resourceInstTable[resourceInstId].getType().getStats(); int statOffset = dataIn.readUnsignedByte(); while (statOffset != ILLEGAL_STAT_OFFSET) {
boolean loadStat(StatDescriptor stat, ResourceInst resource) { ResourceType type = resource.getType(); if (!resource.isLoaded() || !type.isLoaded() || !stat.isLoaded()) { return false; } if (filters == null || filters.length == 0) { return true; } else { String textId = resource.getName(); long numericId = resource.getId(); for (int i=0; i < filters.length; i++) { if (filters[i].statMatches(stat.getName()) && filters[i].typeMatches(type.getName()) && filters[i].instanceMatches(textId, numericId)) { return true; } } return false; } } private void readResourceTypeToken() throws IOException {
boolean loadStat(StatDescriptor stat, ResourceInst resource) { ResourceType type = resource.getType(); if (!resource.isLoaded() || !type.isLoaded() || !stat.isLoaded()) { return false; } if (filters == null || filters.length == 0) { return true; } else { String textId = resource.getName(); long numericId = resource.getId(); for (int i=0; i < filters.length; i++) { if (filters[i].statMatches(stat.getName()) && filters[i].typeMatches(type.getName()) && filters[i].instanceMatches(textId, numericId)) { return true; } } return false; } } private void readResourceTypeToken() throws IOException {
/** * Gets the value of the stat in the current instance given the stat name. * @param name the name of the stat to find in the current instance * @return the value that matches the name or null if the instance * does not have a stat of the given name * */ public StatValue getStatValue(String name) { StatValue result = null; StatDescriptor desc = getType().getStat(name); if (desc != null) { result = values[desc.getOffset()]; } return result; }
public ResourceType getType() { return this.resource.getType(); }
public ResourceType getType() { return this.resource.getType(); }
/** * Gets the value of the stat in the current instance given the stat name. * @param name the name of the stat to find in the current instance * @return the value that matches the name or null if the instance * does not have a stat of the given name * */ public StatValue getStatValue(String name) { StatValue result = null; StatDescriptor desc = getType().getStat(name); if (desc != null) { result = values[desc.getOffset()]; } return result; }