本文整理汇总了C#中ASTContext.FindClass方法的典型用法代码示例。如果您正苦于以下问题:C# ASTContext.FindClass方法的具体用法?C# ASTContext.FindClass怎么用?C# ASTContext.FindClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTContext
的用法示例。
在下文中一共展示了ASTContext.FindClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Preprocess
//.........这里部分代码省略.........
ctx.IgnoreFunctionWithName("LogCreate");
ctx.IgnoreFunctionWithName("AllocatorAllocate");
ctx.IgnoreFunctionWithName("AllocatorDeallocate");
ctx.SetNameOfFunction("AllocatorReset", "AllocatorResetMemory");
ctx.IgnoreClassWithName("StreamFuncs");
ctx.IgnoreClassWithName("FileStream");
ctx.SetClassAsValueType("FileWatchEvent");
ctx.IgnoreFunctionWithPattern(".+GetType");
ctx.IgnoreFunctionWithName("ClassGetIdMap");
ctx.IgnoreFunctionWithName("ReflectionSetHandleContext");
ctx.IgnoreFunctionWithName("SerializerCreateJSON");
ctx.IgnoreFunctionWithName("SerializerCreateBinary");
ctx.IgnoreClassWithName("ReflectionContext");
ctx.IgnoreClassWithName("ValueContext");
ctx.SetClassAsValueType("ExtensionMetadata");
ctx.IgnoreClassWithName("MemoryStream");
ctx.IgnoreClassWithName("Serializer");
ctx.IgnoreClassWithName("Thread");
// Math
ctx.SetClassAsValueType("ColorP");
ctx.SetClassAsValueType("Color");
ctx.SetClassAsValueType("Vector2P");
ctx.SetClassAsValueType("Vector2");
ctx.SetClassAsValueType("Vector2i");
ctx.SetClassAsValueType("Vector3P");
ctx.SetClassAsValueType("Vector3");
ctx.SetClassAsValueType("Vector4");
ctx.SetClassAsValueType("EulerAngles");
ctx.SetClassAsValueType("QuaternionP");
ctx.SetClassAsValueType("Quaternion");
ctx.SetClassAsValueType("Matrix4x3");
ctx.SetClassAsValueType("Matrix4x4");
ctx.CopyClassFields("ColorP", "Color");
ctx.CopyClassFields("Vector2P", "Vector2");
ctx.CopyClassFields("Vector3P", "Vector3");
ctx.CopyClassFields("QuaternionP", "Quaternion");
ctx.IgnoreClassWithName("ColorP");
ctx.IgnoreClassWithName("Vector2P");
ctx.IgnoreClassWithName("Vector3P");
ctx.IgnoreClassWithName("QuaternionP");
ctx.SetNameOfClassMethod("Matrix4x3", "identity", "setIdentity");
ctx.SetNameOfClassMethod("Matrix4x4", "identity", "setIdentity");
ctx.SetNameOfClassMethod("Quaternion", "identity", "setIdentity");
ctx.SetNameOfClassMethod("Vector2", "zero", "setZero");
ctx.SetNameOfClassMethod("Vector3", "zero", "setZero");
ctx.SetNameOfClassMethod("Vector4", "zero", "setZero");
// Resources
ctx.IgnoreFunctionWithName("ResourcesInitialize");
ctx.IgnoreFunctionWithName("ResourcesDeinitialize");
//lib.SetClassAsValueType("ResourceEvent");
ctx.SetClassAsValueType("ResourceLoadOption");
ctx.SetClassAsValueType("ResourceLoadOptions");
ctx.SetNameOfClassMethod("Texture", "allocate", "alloc");
ctx.ExcludeFromPass("ResourceHandleCreate", typeof (FunctionToInstanceMethodPass));
// Set generic type constraints on template methods
var resourceManager = ctx.FindClass("ResourceManager").FirstOrDefault();
if (resourceManager != null)
foreach (var template in resourceManager.Templates)
{
for (var i = 0; i < template.Parameters.Count; ++i)
{
var param = template.Parameters[i];
param.Constraint = "Flood::Resource";
template.Parameters[i] = param;
}
}
// Graphics
ctx.SetClassAsValueType("RenderContextSettings");
ctx.SetClassAsValueType("RenderBatchRange");
ctx.SetClassAsValueType("VertexElementP");
ctx.SetClassAsValueType("VertexElement");
ctx.SetClassAsValueType("UniformBufferElement");
ctx.SetClassAsValueType("RenderState");
ctx.SetClassAsValueType("LightState");
ctx.IgnoreHeadersWithName("MaxRectsBinPack.h");
ctx.IgnoreClassWithName("MaxRectsBinPack");
ctx.IgnoreClassWithName("CompareHandle");
ctx.SetClassAsValueType("Glyph");
ctx.SetClassAsValueType("Rectangle");
ctx.SetClassAsValueType("RectangleF");
ctx.SetClassAsValueType("SubTexture");
ctx.SetMethodParameterUsage("TextureAtlas", "getImageSubTexture", 2, ParameterUsage.Out);
ctx.SetMethodParameterUsage("Font", "getGlyphInfo", 3, ParameterUsage.Out);
// Engine
ctx.IgnoreClassMethodWithName("Engine", "addSubsystem");
}