Esempio n. 1
0
 private static void StopwatchPause(JassInteger id)
 {
     if (list.ContainsKey(id))
     {
         list[id].Stop();
     }
 }
Esempio n. 2
0
 private static void StopwatchReset(JassInteger id)
 {
     if (list.ContainsKey(id))
     {
         list[id].Reset();
     }
 }
Esempio n. 3
0
 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);
            }
        }
Esempio n. 5
0
        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));
            }
        }
Esempio n. 6
0
 private JassInteger StopwatchElapsedMS(JassInteger id)
 {
     return(list[id]?.ElapsedMilliseconds ?? 0);
 }
Esempio n. 7
0
 private static JassRealRet StopwatchTick(JassInteger id)
 => list.ContainsKey(id) ? (float)list[id]?.ElapsedTicks : 0f;
Esempio n. 8
0
 private static JassInteger StopwatchElapsedHour(JassInteger id)
 => list.ContainsKey(id) ? list[id]?.Elapsed.Hours : 0;
Esempio n. 9
0
 private static JassInteger StopwatchElapsedMinute(JassInteger id)
 => list.ContainsKey(id) ? list[id].Elapsed.Minutes : 0;
Esempio n. 10
0
 private static void MemorySetByte(JassInteger offset, JassInteger value)
 => Patch(new IntPtr(offset), (byte)value);
Esempio n. 11
0
 private void StopwatchDestroy(JassInteger id)
 {
     list[id]?.Stop();
 }
Esempio n. 12
0
 private JassInteger StopwatchElapsedHour(JassInteger id)
 {
     return(list[id]?.Elapsed.Hours);
 }
Esempio n. 13
0
 private static JassInteger DzGetUnitNeededXP(JassUnit whichUnit, JassInteger level) => 0;
Esempio n. 14
0
 private static void MemorySetString(JassInteger offset, JassStringArg value)
 => WriteString(new IntPtr(offset), value);
Esempio n. 15
0
 private static JassInteger FindModuleHandle(JassInteger offset, JassInteger signature)
 => FollowPointer(new IntPtr(offset), signature).ToInt32();
Esempio n. 16
0
 private static void MemorySetReal(JassInteger offset, JassRealArg value)
 => Patch(new IntPtr(offset), value);
Esempio n. 17
0
 private static JassRealRet MemoryGetReal(JassInteger offset)
 => ForceReadFloat(new IntPtr(offset));
Esempio n. 18
0
 private static void MemorySetInteger(JassInteger offset, JassInteger value)
 => Patch(new IntPtr(offset), value);
Esempio n. 19
0
 private static JassInteger MemoryGetInteger(JassInteger offset)
 => ForceReadInt(new IntPtr(offset));
Esempio n. 20
0
 private JassInteger StopwatchElapsedSecond(JassInteger id)
 {
     return(id < list.Count ? list[id]?.Elapsed.Seconds ?? 0 : 0);
 }
Esempio n. 21
0
 private JassInteger StopwatchElapsedMinute(JassInteger id)
 {
     return(list[id]?.Elapsed.Minutes);
 }
Esempio n. 22
0
 private static JassInteger BitAnd(JassInteger x, JassInteger y) => x & y;
Esempio n. 23
0
 private JassInteger StopwatchTick(JassInteger id)
 {
     return(list[id]?.ElapsedTicks);
 }
Esempio n. 24
0
 private static JassRealRet I2R(JassInteger i) => BitConverter.ToSingle(BitConverter.GetBytes(i), 0);
Esempio n. 25
0
 private static JassRealRet RequestExtraRealData(JassInteger dataType, JassPlayer whichPlayer, JassStringArg param1, JassStringArg param2, JassBoolean param3, JassInteger param4, JassInteger param5, JassInteger param6) => 0;
Esempio n. 26
0
 private static JassInteger MemoryGetByte(JassInteger offset)
 {
     byte[] buffer = ForceRead(new IntPtr(offset), 1);
     return(buffer == null ? 0 : buffer[0]);
 }
Esempio n. 27
0
 private static JassInteger BitXor(JassInteger x, JassInteger y) => x ^ y;
Esempio n. 28
0
 private static void StopwatchDestroy(JassInteger id)
 => list.Remove(id);
Esempio n. 29
0
 private static JassInteger BitOr(JassInteger x, JassInteger y) => x | y;
Esempio n. 30
0
 private static JassInteger StopwatchElapsedSecond(JassInteger id)
 => list.ContainsKey(id) ? list[id].Elapsed.Seconds : 0;