/// <returns>True if first is lesser than b; otherwise, false</returns>
/// <exception cref="InvalidOperationException">Occurs when you try to compare two <see cref="Watch"/> throughout different <see cref="MemoryDomain"/></exception>
/// <returns>True if first is greater than b; otherwise, false</returns>
/// <exception cref="InvalidOperationException">Occurs when you try to compare two <see cref="Watch"/> throughout different <see cref="MemoryDomain"/></exception>
/// <returns>True if first is lesser or equals to b; otherwise, false</returns>
/// <exception cref="InvalidOperationException">Occurs when you try to compare two <see cref="Watch"/> throughout different <see cref="MemoryDomain"/></exception>
/// <returns>True if first is greater or equals to b; otherwise, false</returns>
/// <exception cref="InvalidOperationException">Occurs when you try to compare two <see cref="Watch"/> throughout different <see cref="MemoryDomain"/></exception>
publicstaticbooloperator>=(Watcha,Watchb)
{
returna.CompareTo(b)>=0;
}
#endregionOperators
#endregionStatic
#regionAbstracts
/// <summary>
/// Gets a list a <see cref="DisplayType"/> that can be used for this <see cref="Watch"/>
/// </summary>
/// <returns>An enumeration that contains all valid <see cref="DisplayType"/></returns>
return_domain.PeekUint(Address,BigEndian);// TODO: % size still isn't correct since it could be the last byte of the domain
}
return_domain.PeekUint(Address%_domain.Size,BigEndian);// TODO: % size still isn't correct since it could be the last byte of the domain
}
protectedvoidPokeByte(byteval)
{
if(_domain.Size==0)
{
_domain.PokeByte(Address,val);
}
else
{
_domain.PokeByte(Address%_domain.Size,val);
}
}
protectedvoidPokeWord(ushortval)
{
if(_domain.Size==0)
{
_domain.PokeUshort(Address,val,BigEndian);// TODO: % size still isn't correct since it could be the last byte of the domain
}
else
{
_domain.PokeUshort(Address%_domain.Size,val,BigEndian);// TODO: % size still isn't correct since it could be the last byte of the domain
}
}
protectedvoidPokeDWord(uintval)
{
if(_domain.Size==0)
{
_domain.PokeUint(Address,val,BigEndian);// TODO: % size still isn't correct since it could be the last byte of the domain
}
else
{
_domain.PokeUint(Address%_domain.Size,val,BigEndian);// TODO: % size still isn't correct since it could be the last byte of the domain
}
}
#endregionProtected
/// <summary>
/// Sets the number of changes to 0
/// </summary>
publicvoidClearChangeCount()
{
ChangeCount=0;
}
#regionIEquatable<Watch>
/// <summary>
/// Determines if this <see cref="Watch"/> is equals to another
/// </summary>
/// <param name="other">The <see cref="Watch"/> to compare</param>
/// <returns>True if both object are equals; otherwise, false</returns>
publicboolEquals(Watchother)
{
if(ReferenceEquals(other,null))
{
returnfalse;
}
return_domain==other._domain&&
Address==other.Address&&
Size==other.Size;
}
#endregionIEquatable<Watch>
#regionIEquatable<Cheat>
/// <summary>
/// Determines if this <see cref="Watch"/> is equals to an instance of <see cref="Cheat"/>
/// </summary>
/// <param name="other">The <see cref="Cheat"/> to compare</param>
/// <returns>True if both object are equals; otherwise, false</returns>
publicboolEquals(Cheatother)
{
return!ReferenceEquals(other,null)
&&_domain==other.Domain
&&Address==other.Address
&&Size==other.Size;
}
#endregionIEquatable<Cheat>
#regionIComparable<Watch>
/// <summary>
/// Compares two <see cref="Watch"/> together and determine which one comes first.
/// First we look the address and then the size
/// </summary>
/// <param name="other">The other <see cref="Watch"/> to compare to</param>
/// <returns>0 if they are equals, 1 if the other is greater, -1 if the other is lesser</returns>
/// <exception cref="InvalidOperationException">Occurs when you try to compare two <see cref="Watch"/> throughout different <see cref="MemoryDomain"/></exception>
publicintCompareTo(Watchother)
{
if(_domain!=other._domain)
{
thrownewInvalidOperationException("Watch cannot be compared through different domain");
}
if(Equals(other))
{
return0;
}
if(Address.Equals(other.Address))
{
return((int)Size).CompareTo((int)other.Size);
}
returnAddress.CompareTo(other.Address);
}
#endregionIComparable<Watch>
/// <summary>
/// Determines if this object is Equals to another
/// </summary>
/// <param name="obj">The object to compare</param>
/// <returns>True if both object are equals; otherwise, false</returns>
publicoverrideboolEquals(objectobj)
{
if(objisWatch)
{
returnEquals((Watch)obj);
}
if(objisCheat)
{
returnEquals((Cheat)obj);
}
returnbase.Equals(obj);
}
/// <summary>
/// Hash the current watch and gets a unique value
/// </summary>
/// <returns><see cref="int"/> that can serves as a unique representation of current Watch</returns>
publicoverrideintGetHashCode()
{
returnDomain.GetHashCode()+(int)Address;
}
/// <summary>
/// Determines if the specified <see cref="DisplayType"/> can be
/// used for the current <see cref="Watch"/>
/// </summary>
/// <param name="type"><see cref="DisplayType"/> you want to check</param>
publicboolIsDiplayTypeAvailable(DisplayTypetype)
{
returnAvailableTypes().Any(d=>d==type);
}
/// <summary>
/// Transforms the current instance into a string
/// </summary>
/// <returns>A <see cref="string"/> representation of the current <see cref="Watch"/></returns>