public static int Compare(UStatus a, UStatus b) { if (a.m_fstatus == null && b.m_fstatus == null) { return(0); } if (a.m_fstatus == null && b.m_fstatus != null) { return(-1); } if (a.m_fstatus != null && b.m_fstatus == null) { return(1); } if (a.m_isOwn && !b.m_isOwn) { return(-1); } if (!a.m_isOwn && b.m_isOwn) { return(1); } if (a.m_fstatus.IsDebuff && !b.m_fstatus.IsDebuff) { return(-1); } if (!a.m_fstatus.IsDebuff && b.m_fstatus.IsDebuff) { return(1); } return(a.m_index.CompareTo(b.m_index)); }
public static bool SetOffset(Stream stream) { using (var reader = new StreamReader(stream, Encoding.UTF8, true, 4096, true)) { try { var serializer = new JsonSerializer(); using (var jsonReader = new JsonTextReader(reader)) memoryOffset = serializer.Deserialize <MemoryOffset>(jsonReader); } catch { return(false); } } ShowTargetStatus = Settings.Instance.ShowTargetStatus; UStatus ustatus; Statuses = new UStatus[memoryOffset.StatusCount]; for (int i = 0; i < memoryOffset.StatusCount; ++i) { ustatus = new UStatus(i); Statuses[i] = ustatus; SortedStatuses.Add(ustatus); SortedStatusesByTime.Add(ustatus); } return(true); }
public static int CompareWithTime(UStatus a, UStatus b) { if (a.m_fstatus == null && b.m_fstatus == null) { return(0); } if (a.m_fstatus == null && b.m_fstatus != null) { return(-1); } if (a.m_fstatus != null && b.m_fstatus == null) { return(1); } if (a.m_isOwn && !b.m_isOwn) { return(-1); } if (!a.m_isOwn && b.m_isOwn) { return(1); } if (a.m_fstatus.IsDebuff && !b.m_fstatus.IsDebuff) { return(-1); } if (!a.m_fstatus.IsDebuff && b.m_fstatus.IsDebuff) { return(1); } var compare = a.m_remain.CompareTo(b.m_remain); if (compare != 0) { return(compare); } return(a.m_index.CompareTo(b.m_index)); }