private static void StopwatchPause(JassInteger id) { if (list.ContainsKey(id)) { list[id].Stop(); } }
private static void StopwatchReset(JassInteger id) { if (list.ContainsKey(id)) { list[id].Reset(); } }
private static JassStringRet MemoryGetString(JassInteger offset, JassInteger length) { if (length > 0) { return(ReadString(new IntPtr(offset), length)); } else { return(ReadString(new IntPtr(offset))); } }
private static void SetSyncDelay(JassInteger delay) { int value = delay; value = value <= 10 ? 10 : value >= 550 ? 550 : value; IntPtr ptr = FollowPointer(StormDll + 0x58330, 0x68DBD6C0); if (ptr == IntPtr.Zero) { return; } else { ptr += 0x2F0; } for (int i = 0; i <= 0x440; i += 0x220) { Patch(ptr + i, value); } }
private static JassStringRet StringSub(JassStringArg str, JassInteger start, JassInteger length) { string Str = str.ToString(); int Start = start, Length = length; if (Str == null || Start >= Str.Length || Length == 0) { return(string.Empty); } if (Start < 0) { Length += Start; Start = 0; } if (Length < 0 || Start + Length > Str.Length) { return(Str.Substring(Start)); } else { return(Str.Substring(Start, Length)); } }
private JassInteger StopwatchElapsedMS(JassInteger id) { return(list[id]?.ElapsedMilliseconds ?? 0); }
private static JassRealRet StopwatchTick(JassInteger id) => list.ContainsKey(id) ? (float)list[id]?.ElapsedTicks : 0f;
private static JassInteger StopwatchElapsedHour(JassInteger id) => list.ContainsKey(id) ? list[id]?.Elapsed.Hours : 0;
private static JassInteger StopwatchElapsedMinute(JassInteger id) => list.ContainsKey(id) ? list[id].Elapsed.Minutes : 0;
private static void MemorySetByte(JassInteger offset, JassInteger value) => Patch(new IntPtr(offset), (byte)value);
private void StopwatchDestroy(JassInteger id) { list[id]?.Stop(); }
private JassInteger StopwatchElapsedHour(JassInteger id) { return(list[id]?.Elapsed.Hours); }
private static JassInteger DzGetUnitNeededXP(JassUnit whichUnit, JassInteger level) => 0;
private static void MemorySetString(JassInteger offset, JassStringArg value) => WriteString(new IntPtr(offset), value);
private static JassInteger FindModuleHandle(JassInteger offset, JassInteger signature) => FollowPointer(new IntPtr(offset), signature).ToInt32();
private static void MemorySetReal(JassInteger offset, JassRealArg value) => Patch(new IntPtr(offset), value);
private static JassRealRet MemoryGetReal(JassInteger offset) => ForceReadFloat(new IntPtr(offset));
private static void MemorySetInteger(JassInteger offset, JassInteger value) => Patch(new IntPtr(offset), value);
private static JassInteger MemoryGetInteger(JassInteger offset) => ForceReadInt(new IntPtr(offset));
private JassInteger StopwatchElapsedSecond(JassInteger id) { return(id < list.Count ? list[id]?.Elapsed.Seconds ?? 0 : 0); }
private JassInteger StopwatchElapsedMinute(JassInteger id) { return(list[id]?.Elapsed.Minutes); }
private static JassInteger BitAnd(JassInteger x, JassInteger y) => x & y;
private JassInteger StopwatchTick(JassInteger id) { return(list[id]?.ElapsedTicks); }
private static JassRealRet I2R(JassInteger i) => BitConverter.ToSingle(BitConverter.GetBytes(i), 0);
private static JassRealRet RequestExtraRealData(JassInteger dataType, JassPlayer whichPlayer, JassStringArg param1, JassStringArg param2, JassBoolean param3, JassInteger param4, JassInteger param5, JassInteger param6) => 0;
private static JassInteger MemoryGetByte(JassInteger offset) { byte[] buffer = ForceRead(new IntPtr(offset), 1); return(buffer == null ? 0 : buffer[0]); }
private static JassInteger BitXor(JassInteger x, JassInteger y) => x ^ y;
private static void StopwatchDestroy(JassInteger id) => list.Remove(id);
private static JassInteger BitOr(JassInteger x, JassInteger y) => x | y;
private static JassInteger StopwatchElapsedSecond(JassInteger id) => list.ContainsKey(id) ? list[id].Elapsed.Seconds : 0;