AKunSimulator/Global/SingleValue.cs

46 lines
1.2 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Global.SingleValue
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Collections.Generic;
namespace Global
{
public class SingleValue
{
public static int TriggleMaxCount = 180000;
public static int TriggleMiniCount = 500;
public static int TriggleHighValue = 48000;
public static int TriggleLowValue = 45000;
public static int MidCacheMaxCount = 180000;
public static int[] GetTrigglePoint(ushort[] buf, int MaxCount)
{
List<int> intList = new List<int>();
int num = 0;
bool flag = false;
for (int index = 0; index < buf.Length; ++index)
{
if (flag)
{
if ((int) buf[index] > SingleValue.TriggleHighValue)
{
intList.Add(index);
++num;
if (num < MaxCount)
flag = false;
else
break;
}
}
else if ((int) buf[index] < SingleValue.TriggleLowValue)
flag = true;
}
return intList.ToArray();
}
}
}