Package smart.updater.searches

Source Code of smart.updater.searches.NPCNodes

package smart.updater.searches;

import java.util.HashMap;
import java.util.Map.Entry;

import org.apache.bcel.classfile.*;
import org.apache.bcel.generic.*;

import smart.updater.RSClass;
import smart.updater.RSClient;
import smart.updater.Search;

public class NPCNodes extends Search{

  @Override
  public SearchResult run(RSClient data, HashMap<String, ClassGen> classes) {
    for(Entry<String, ClassGen> c : classes.entrySet()){
      RSClass npcNode = data.getProperClass("NPCNode");
      //if(c.getValue()){
        ConstantPoolGen cpg = c.getValue().getConstantPool();
        for(Field f : c.getValue().getFields()){
          if(f.isStatic() && f.getType().toString().equals(npcNode.className+"[]")){
            data.addField("NPCNodes", c.getValue().getClassName()+'.'+f.getName());
            return SearchResult.Success;
          }
        }
      //}
    }
    return SearchResult.Failure;
  }

}
TOP

Related Classes of smart.updater.searches.NPCNodes

TOP
Copyright © 2018 www.massapi.com. 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.