/[RomCheater]/trunk/RomCheater/Docking/MemorySearch/_16bit_unsigned_comparer_.cs
ViewVC logotype

Annotation of /trunk/RomCheater/Docking/MemorySearch/_16bit_unsigned_comparer_.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 280 - (hide annotations) (download)
Tue Jun 5 00:13:29 2012 UTC (9 years, 3 months ago) by william
File size: 1440 byte(s)
+ import search code from PCSX2 Ram Dump (no need to re-invent the wheel...plus it cuts down on code refactoring time)

1 william 280 using System;
2     using System.Collections.Generic;
3     using System.Linq;
4     using System.Text;
5    
6     namespace RomCheater.Docking.MemorySearch
7     {
8     public class _16bit_unsigned_comparer_ : MemComparer<ushort>, IMemComparer<ushort>
9     {
10     public _16bit_unsigned_comparer_(SearchType search_settings, int FoundAddress)
11     : base(search_settings, FoundAddress, 0)
12     {
13     }
14     #region IMemComparer<T> Members
15     public bool Compare(ushort CompareToValue, ushort CompareFromValue)
16     {
17     this.Value = CompareToValue;
18     switch (base.SearchSettings.CompareType)
19     {
20     case SearchCompareTypes.Equal:
21     return (CompareToValue == CompareFromValue);
22     case SearchCompareTypes.GreaterThan:
23     return (CompareToValue > CompareFromValue);
24     case SearchCompareTypes.GreaterThanOrEqual:
25     return (CompareToValue >= CompareFromValue);
26     case SearchCompareTypes.LessThan:
27     return (CompareToValue < CompareFromValue);
28     case SearchCompareTypes.LessThanOrEqual:
29     return (CompareToValue <= CompareFromValue);
30     case SearchCompareTypes.NotEqual:
31     return (CompareToValue != CompareFromValue);
32     }
33     return false;
34     }
35     #endregion
36     }
37     }

  ViewVC Help
Powered by ViewVC 1.1.22