Word Game Builder 2.0.1f2
Reference Manual
Public Member Functions | Static Public Member Functions | Properties | List of all members
Letter Struct Reference

Represents a letter. More...

+ Inheritance diagram for Letter:
+ Collaboration diagram for Letter:

Public Member Functions

 Letter (string text, char charValue, int score)
 Creates a new letter. More...
 
int CompareTo (Letter other)
 Compares this letter to another one, by their human-readable string values and the current culture. More...
 
int CompareTo (Letter other, System.Globalization.CultureInfo culture)
 Compares this letter to another one, by their human-readable string values and the specified culture. More...
 
override bool Equals (object obj)
 Override for System.Object.Equals. More...
 
bool Equals (Letter other)
 Tests value-based equality between two letters. More...
 
override int GetHashCode ()
 Override for System.Object.GetHashCode. More...
 

Static Public Member Functions

static bool operator!= (Letter a, Letter b)
 Tests value-based non-equality between two letters. More...
 
static bool operator== (Letter a, Letter b)
 Tests value-based equality between two letters. More...
 

Properties

char character [get]
 Gets the character associated with the letter. More...
 
static Letter empty [get]
 Returns an empty letter. More...
 
bool hasValue [get]
 Does the letter have a value? More...
 
int score [get]
 Gets the score associated with the letter. More...
 
string text [get]
 Gets the text associated with the letter. More...
 

Detailed Description

Represents a letter.

Note that this type is passed by value for performance reasons.

Constructor & Destructor Documentation

Letter ( string  text,
char  charValue,
int  score 
)
inline

Creates a new letter.

Parameters
textA human-readable string representing the letter.
charValueA machine-character representing the letter.
scoreThe point value of the letter.

Member Function Documentation

int CompareTo ( Letter  other)
inline

Compares this letter to another one, by their human-readable string values and the current culture.

Two letters are equal if they have the same text and character, or are both blank.

Parameters
otherThe other letter to compare with this one.
Returns
A signed number indicating the relative values of this instance and other.
int CompareTo ( Letter  other,
System.Globalization.CultureInfo  culture 
)
inline

Compares this letter to another one, by their human-readable string values and the specified culture.

Two letters are equal if they have the same text and character, or are both blank.

Parameters
otherThe other letter to compare with this one.
cultureThe culture to use for the comparison.
Returns
A signed number indicating the relative values of this instance and other.

+ Here is the call graph for this function:

override bool Equals ( object  obj)
inline

Override for System.Object.Equals.

Parameters
objThe object to compare this letter with.
Returns
true if the letters are equal, otherwise false.

+ Here is the caller graph for this function:

bool Equals ( Letter  other)
inline

Tests value-based equality between two letters.

Two letters are equal if they have the same text and character, or are both blank.

Parameters
otherThe other letter to compare with this one.
Returns

true if the letters are equal, otherwise false.

A signed number indicating the relative values of this instance and other.

override int GetHashCode ( )
inline

Override for System.Object.GetHashCode.

Returns
A hash code of the current letter.

+ Here is the caller graph for this function:

static bool operator!= ( Letter  a,
Letter  b 
)
inlinestatic

Tests value-based non-equality between two letters.

Two letters are equal if they have the same text and character, or are both blank.

Parameters
aThe first letter to compare.
bThe second letter to compare.
Returns
true if the letters are NOT equal, otherwise false.
static bool operator== ( Letter  a,
Letter  b 
)
inlinestatic

Tests value-based equality between two letters.

Two letters are equal if they have the same text and character, or are both blank.

Parameters
aThe first letter to compare.
bThe second letter to compare.
Returns
true if the letters are equal, otherwise false.

Property Documentation

char character
get

Gets the character associated with the letter.

The character is used for lookups into the langauge dictionary.

Letter empty
staticget

Returns an empty letter.

bool hasValue
get

Does the letter have a value?

int score
get

Gets the score associated with the letter.

string text
get

Gets the text associated with the letter.

This is the actual display text for the letter.