NVelocity/Util/Introspection/Twonk.cs
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
namespace NVelocity.Util.Introspection
{
/// <summary>
/// little class to hold 'distance' information
/// for calling params, as well as determine
/// specificity
/// </summary>
internal class Twonk
{
public int[] vec;
public Twonk(int size)
{
vec = new int[size];
}
public int moreSpecific(Twonk other)
{
if (other.vec.Length != vec.Length)
return - 1;
bool low = false;
bool high = false;
for(int i = 0; i < vec.Length; i++)
{
if (vec[i] > other.vec[i])
{
high = true;
}
else if (vec[i] < other.vec[i])
{
low = true;
}
}
/*
* this is a 'crossing' - meaning that
* we saw the parameter 'slopes' cross
* this means ambiguity
*/
if (high && low)
return 0;
/*
* we saw that all args were 'high', meaning
* that the other method is more specific so
* we are less
*/
if (high && !low)
return - 1;
/*
* we saw that all points were lower, therefore
* we are more specific
*/
if (!high && low)
后面还有 12 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
