Ensure mapping entry fields are set to sane values.

master
Nabile Rahmani 2018-11-21 17:30:21 +01:00
parent 18c8b8d041
commit 6e8ff81e58
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using System;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
namespace DotN64
@ -6,9 +7,9 @@ namespace DotN64
public struct MappingEntry
{
#region Properties
public uint StartAddress { get; set; }
public uint StartAddress { get; }
public uint EndAddress { get; set; }
public uint EndAddress { get; }
public bool OffsetAddress { get; set; }
@ -24,6 +25,8 @@ namespace DotN64
StartAddress = startAddress;
EndAddress = endAddress;
OffsetAddress = offsetAddress;
Contract.Ensures(EndAddress >= StartAddress);
}
#endregion