public static RuntimeIshtarMethod GetMethod(uint index, QualityTypeName owner, VeinModule module, CallFrame frame) { var clazz = module.FindType(owner); var name = module.GetConstStringByIndex((int)index); var method = clazz.FindMethod(name, m => m.Name.Equals(name)); if (method is null) { FastFail(WNE.MISSING_METHOD, $"Method '{name}' not found in '{clazz.FullName.NameWithNS}'", frame); ValidateLastError(); return(null); } Assert(method is RuntimeIshtarMethod, WNE.MISSING_METHOD, $"metadata is corrupted."); return((RuntimeIshtarMethod)method); }
public static RuntimeIshtarClass GetClass(uint index, VeinModule module, CallFrame frame) { var name = module.types_table.GetValueOrDefault((int)index); Assert(name is not null, WNE.TYPE_LOAD, $"Cant find '{index}' in class_table.", frame); var type = module.FindType(name, true, false); if (type is UnresolvedVeinClass) { FastFail(WNE.MISSING_TYPE, $"Cant load '{name.NameWithNS}' in '{name.AssemblyName}'", frame); ValidateLastError(); return(null); } Assert(type is RuntimeIshtarClass, WNE.TYPE_LOAD, $"metadata is corrupted."); return(type as RuntimeIshtarClass); }