C# Class Zyrenth.Zora.Secret

Represents a secret used in the Zelda Oracle series games.
Inheritance: INotifyPropertyChanged
Show file Open project: kabili207/zora-sharp

Public Methods

Method Description
Equals ( object obj ) : bool

Determines whether the specified System.Object, is equal to this instance.

GetHashCode ( ) : int

Returns a hash code for this instance.

Load ( GameInfo info ) : void

Loads in data from the specified game info

Load ( byte secret ) : void

Loads in data from the raw secret data provided

Load ( string secret ) : void

Loads in data from the secret string provided

ToBytes ( ) : byte[]

Gets the raw secret data as a byte array

ToString ( ) : string

Returns a string that represents the current secret.

ToString will format the secret as it would be represented in the games. Internally, this method calls ToBytes and passes the result to SecretParser.CreateString.

Protected Methods

Method Description
BinaryStringToByteArray ( string data ) : byte[]

Converts a binary string (i.e. a string of ones and zeros) to a byte array

ByteArrayToBinaryString ( byte secret ) : string

Converts a byte array to a string representation of ones and zeros

CalculateChecksum ( byte secret ) : byte

Calculates the checksum for the specified secret

DecodeBytes ( byte secret ) : byte[]

Takes an encoded secret, as used by the games, and decodes it.

EncodeBytes ( byte data ) : byte[]

Takes a raw, unencoded secret and encodes it.

NotifyPropertyChanged ( string propertyName ) : void

Sends a notification that a property has changed.

Method Details

BinaryStringToByteArray() protected method

Converts a binary string (i.e. a string of ones and zeros) to a byte array
protected BinaryStringToByteArray ( string data ) : byte[]
data string The binary string
return byte[]

ByteArrayToBinaryString() protected method

Converts a byte array to a string representation of ones and zeros
protected ByteArrayToBinaryString ( byte secret ) : string
secret byte The secret.
return string

CalculateChecksum() protected method

Calculates the checksum for the specified secret
protected CalculateChecksum ( byte secret ) : byte
secret byte The secret
return byte

DecodeBytes() protected method

Takes an encoded secret, as used by the games, and decodes it.
protected DecodeBytes ( byte secret ) : byte[]
secret byte The encoded secret.
return byte[]

EncodeBytes() protected method

Takes a raw, unencoded secret and encodes it.
protected EncodeBytes ( byte data ) : byte[]
data byte The secret data.
return byte[]

Equals() public method

Determines whether the specified System.Object, is equal to this instance.
public Equals ( object obj ) : bool
obj object The to compare with this instance.
return bool

GetHashCode() public method

Returns a hash code for this instance.
public GetHashCode ( ) : int
return int

Load() public abstract method

Loads in data from the specified game info
public abstract Load ( GameInfo info ) : void
info GameInfo The game info
return void

Load() public abstract method

Loads in data from the raw secret data provided
public abstract Load ( byte secret ) : void
secret byte The raw secret data
return void

Load() public method

Loads in data from the secret string provided
public Load ( string secret ) : void
secret string The secret
return void

NotifyPropertyChanged() protected method

Sends a notification that a property has changed.
protected NotifyPropertyChanged ( string propertyName ) : void
propertyName string Name of the property.
return void

ToBytes() public abstract method

Gets the raw secret data as a byte array
public abstract ToBytes ( ) : byte[]
return byte[]

ToString() public method

Returns a string that represents the current secret.
ToString will format the secret as it would be represented in the games. Internally, this method calls ToBytes and passes the result to SecretParser.CreateString.
public ToString ( ) : string
return string