55
66namespace ReClassNET . AddressParser
77{
8- interface Operation
8+ internal interface IOperation
99 {
1010
1111 }
1212
13- class OffsetOperation : Operation
13+ internal class OffsetOperation : IOperation
1414 {
1515 public OffsetOperation ( IntPtr value )
1616 {
@@ -21,8 +21,7 @@ public OffsetOperation(IntPtr value)
2121
2222 public override bool Equals ( object obj )
2323 {
24- var other = obj as OffsetOperation ;
25- if ( other != null )
24+ if ( obj is OffsetOperation other )
2625 {
2726 return Value . Equals ( other . Value ) ;
2827 }
@@ -38,21 +37,21 @@ public override int GetHashCode()
3837 }
3938 }
4039
41- class ReadPointerOperation : Operation
40+ internal class ReadPointerOperation : IOperation
4241 {
43- public ReadPointerOperation ( Operation argument )
42+ public ReadPointerOperation ( IOperation argument )
4443 {
4544 Contract . Requires ( argument != null ) ;
4645
4746 Argument = argument ;
4847 }
4948
50- public Operation Argument { get ; }
49+ public IOperation Argument { get ; }
5150 }
5251
53- class AdditionOperation : Operation
52+ internal class AdditionOperation : IOperation
5453 {
55- public AdditionOperation ( Operation argument1 , Operation argument2 )
54+ public AdditionOperation ( IOperation argument1 , IOperation argument2 )
5655 {
5756 Contract . Requires ( argument1 != null ) ;
5857 Contract . Requires ( argument2 != null ) ;
@@ -61,13 +60,13 @@ public AdditionOperation(Operation argument1, Operation argument2)
6160 Argument2 = argument2 ;
6261 }
6362
64- public Operation Argument1 { get ; }
65- public Operation Argument2 { get ; }
63+ public IOperation Argument1 { get ; }
64+ public IOperation Argument2 { get ; }
6665 }
6766
68- class SubtractionOperation : Operation
67+ internal class SubtractionOperation : IOperation
6968 {
70- public SubtractionOperation ( Operation argument1 , Operation argument2 )
69+ public SubtractionOperation ( IOperation argument1 , IOperation argument2 )
7170 {
7271 Contract . Requires ( argument1 != null ) ;
7372 Contract . Requires ( argument2 != null ) ;
@@ -76,13 +75,13 @@ public SubtractionOperation(Operation argument1, Operation argument2)
7675 Argument2 = argument2 ;
7776 }
7877
79- public Operation Argument1 { get ; }
80- public Operation Argument2 { get ; }
78+ public IOperation Argument1 { get ; }
79+ public IOperation Argument2 { get ; }
8180 }
8281
83- class DivisionOperation : Operation
82+ internal class DivisionOperation : IOperation
8483 {
85- public DivisionOperation ( Operation dividend , Operation divisor )
84+ public DivisionOperation ( IOperation dividend , IOperation divisor )
8685 {
8786 Contract . Requires ( dividend != null ) ;
8887 Contract . Requires ( divisor != null ) ;
@@ -91,13 +90,13 @@ public DivisionOperation(Operation dividend, Operation divisor)
9190 Divisor = divisor ;
9291 }
9392
94- public Operation Dividend { get ; }
95- public Operation Divisor { get ; }
93+ public IOperation Dividend { get ; }
94+ public IOperation Divisor { get ; }
9695 }
9796
98- class MultiplicationOperation : Operation
97+ internal class MultiplicationOperation : IOperation
9998 {
100- public MultiplicationOperation ( Operation argument1 , Operation argument2 )
99+ public MultiplicationOperation ( IOperation argument1 , IOperation argument2 )
101100 {
102101 Contract . Requires ( argument1 != null ) ;
103102 Contract . Requires ( argument2 != null ) ;
@@ -106,11 +105,11 @@ public MultiplicationOperation(Operation argument1, Operation argument2)
106105 Argument2 = argument2 ;
107106 }
108107
109- public Operation Argument1 { get ; }
110- public Operation Argument2 { get ; }
108+ public IOperation Argument1 { get ; }
109+ public IOperation Argument2 { get ; }
111110 }
112111
113- class ModuleOffsetOperation : Operation
112+ internal class ModuleOffsetOperation : IOperation
114113 {
115114 public ModuleOffsetOperation ( string name )
116115 {
@@ -123,8 +122,7 @@ public ModuleOffsetOperation(string name)
123122
124123 public override bool Equals ( object obj )
125124 {
126- var other = obj as ModuleOffsetOperation ;
127- if ( other != null )
125+ if ( obj is ModuleOffsetOperation other )
128126 {
129127 return Name . Equals ( other . Name ) ;
130128 }
0 commit comments