PapaganEgitim::GameInterface Class Reference

Interface class for the game. More...

List of all members.

Public Member Functions

 GameInterface ()
void updateLabels (System.Windows.Forms.Label label, String currentValue)
String getCurrentAnswer ()
void setCurrentAnswer (String current)
char getCurrentInitial ()
void setCurrentInitial (char current)
int getCurrentTotalScore ()
void setCurrentTotalScore (int current)
int getCurrentScoreForQuestion ()
void setCurrentScoreForQuestion (int current)
String getCurrentWord ()
void setCurrentWord (String current)
int getCurrentWordId ()
void setCurrentWordId (int current)
int getSecondsLeft ()
void setSecondsLeft (int current)
System.Timers.Timer getTimer ()
void setTimer ()

Protected Member Functions

override void Dispose (bool disposing)

Private Member Functions

void InitializeComponent ()
void answerButton_Click (object sender, System.EventArgs e)
void categoryButton_Click (object sender, System.EventArgs e)
void OnTimedEvent (object source, System.Timers.ElapsedEventArgs e)

Private Attributes

System.Windows.Forms.GroupBox hintGroupBox
System.Windows.Forms.TextBox answerTextBox
System.Windows.Forms.GroupBox answerGroupBox
AxShockwaveFlashObjects.AxShockwaveFlash flashWindow
System.ComponentModel.IContainer components
System.Windows.Forms.Label currentTotalScoreLabel
String currentWord
int currentWordId
int currentScore
int currentScoreForQuestion
int secondsLeft
char currentInitial
System.Windows.Forms.Button answerButton
System.Windows.Forms.Button categoryButton
System.Windows.Forms.GroupBox currentTotalScoreGroupBox
System.Windows.Forms.GroupBox currentScoreGroupBox
System.Windows.Forms.Label currentScoreLabel
System.Windows.Forms.GroupBox timerGroupBox
System.Windows.Forms.Label timerLabel
System.Windows.Forms.Label hintLabel
System.Windows.Forms.GroupBox currentInitialGroupBox
System.Windows.Forms.Label currentInitialLabel
String currentAnswer
System.Timers.Timer timer


Detailed Description

Interface class for the game.


Constructor & Destructor Documentation

PapaganEgitim::GameInterface::GameInterface  )  [inline]
 

Constructor for the class.

This constructor first initialize the private form variables. Then the current score, current word ID, timer, seconds left and current score for question is set.

See also:
setCurrentTotalScore(), setCurrentWordId(), setTimer(), setSecondsLeft(), setCurrentScoreForQuestion()


Member Function Documentation

void PapaganEgitim::GameInterface::answerButton_Click object  sender,
System.EventArgs  e
[inline, private]
 

The callback function called when the confirmation button "Cevapla" is pressed.

This function first checks whether the guess on the editable textbox is case insensitively equal to the answer. If they are equal a PapaganDAO query for a word starts where the new words initial is the last answers last letter. If the query fails to find such a word a random initial is set and the query is repeated till success. Then the label are set for the new word. The total score is updated, the last questions award is added. The initial label is set as the new words initial. The hint label is cleaned, the cronometer label is set again and the questions score is set to 100. If the guess fails the textbox is cleaned. A punishment which is the half of the current questions score is decreased from the total score.

void PapaganEgitim::GameInterface::categoryButton_Click object  sender,
System.EventArgs  e
[inline, private]
 

The callback function called when the hint button "Kategori" is pressed.

When the button is pressed a query for retrieving the categories list is called. A random index value is given to the list to take a category string. The string is printed on the hint label and the current questions reward is halveda and the label is updated to observe the change. If the award for the current question is 0, the right answer is printed on the hint label.

override void PapaganEgitim::GameInterface::Dispose bool  disposing  )  [inline, protected]
 

Clean up any resources being used.

String PapaganEgitim::GameInterface::getCurrentAnswer  )  [inline]
 

A get function for accessing current answer.

Returns:
A String object that has the current animations word.

char PapaganEgitim::GameInterface::getCurrentInitial  )  [inline]
 

A get function for accessing current right answers initial letter.

Returns:
A character which is the initial letter mentioned.

int PapaganEgitim::GameInterface::getCurrentScoreForQuestion  )  [inline]
 

A get function for accessing current questions score.

Returns:
An integer value that has the current animations score as current reward.

int PapaganEgitim::GameInterface::getCurrentTotalScore  )  [inline]
 

A get function for accessing current total score.

Returns:
An integer value which is equal to the current total score.

String PapaganEgitim::GameInterface::getCurrentWord  )  [inline]
 

A get function for accessing the answer given.

Returns:
A String object that has the string given as an answer by the user.

int PapaganEgitim::GameInterface::getCurrentWordId  )  [inline]
 

A get function for accessing current word id.

Returns:
An integer value which is equal to the word id taken from the database.

int PapaganEgitim::GameInterface::getSecondsLeft  )  [inline]
 

A get function for asking the seconds left.

Returns:
An integer value which is equal to the time left to answer before losing points.

System.Timers.Timer PapaganEgitim::GameInterface::getTimer  )  [inline]
 

A get function for accessing the private timer object.

Returns:
A System.Timers.Timer object that is set as our timer.

void PapaganEgitim::GameInterface::InitializeComponent  )  [inline, private]
 

Makes the GUI definition.

void PapaganEgitim::GameInterface::OnTimedEvent object  source,
System.Timers.ElapsedEventArgs  e
[inline, private]
 

Cronometer.

This function calls itself in every second. It reads the seconds left and decreases the value and set the seconds left. If the timer is equal to 0, the current questions award is halved. The label is updated to observe the change. Also the cronometer label is updated in each call so the seconds left can be tracked in every second. As mentioned before, if the questions award is equal to 0, the right answer is printed on the hint label.

void PapaganEgitim::GameInterface::setCurrentAnswer String  current  )  [inline]
 

A set function for filling current answer variable.

Parameters:
current A String argument that will be set to the current right answer.

void PapaganEgitim::GameInterface::setCurrentInitial char  current  )  [inline]
 

A set function for filling current answers initial letter variable.

Parameters:
current A character argument that will be set to current animations words initial letter.

void PapaganEgitim::GameInterface::setCurrentScoreForQuestion int  current  )  [inline]
 

A set function for setting the current.

Parameters:
current An integer value that will be set to the current reward.

void PapaganEgitim::GameInterface::setCurrentTotalScore int  current  )  [inline]
 

A set function for keeping the over current total score.

Parameters:
current An integer value that will be set to the current total score variable.

void PapaganEgitim::GameInterface::setCurrentWord String  current  )  [inline]
 

A set function for storing the answer given.

Parameters:
current A String argument that will be set to the current user guess.

void PapaganEgitim::GameInterface::setCurrentWordId int  current  )  [inline]
 

A set function for updating current word id.

Parameters:
current An integer value which will be stored to remember the id taken from database.

void PapaganEgitim::GameInterface::setSecondsLeft int  current  )  [inline]
 

A set function for renewing the value for seconds left.

Parameters:
current A integer value that will be set to the current left seconds to answer without losing any more points.

void PapaganEgitim::GameInterface::setTimer  )  [inline]
 

Enables timed event mechanism and fills our variable for timing.

void PapaganEgitim::GameInterface::updateLabels System.Windows.Forms.Label  label,
String  currentValue
[inline]
 

updates the desired labels

Given string is updated and the new value is the second argument.

Parameters:
label The label that is going to be updated
currentValue The string that will be typed on the label given


Member Data Documentation

System.Windows.Forms.Button PapaganEgitim::GameInterface::answerButton [private]
 

System.Windows.Forms.GroupBox PapaganEgitim::GameInterface::answerGroupBox [private]
 

System.Windows.Forms.TextBox PapaganEgitim::GameInterface::answerTextBox [private]
 

System.Windows.Forms.Button PapaganEgitim::GameInterface::categoryButton [private]
 

System.ComponentModel.IContainer PapaganEgitim::GameInterface::components [private]
 

String PapaganEgitim::GameInterface::currentAnswer [private]
 

char PapaganEgitim::GameInterface::currentInitial [private]
 

System.Windows.Forms.GroupBox PapaganEgitim::GameInterface::currentInitialGroupBox [private]
 

System.Windows.Forms.Label PapaganEgitim::GameInterface::currentInitialLabel [private]
 

int PapaganEgitim::GameInterface::currentScore [private]
 

int PapaganEgitim::GameInterface::currentScoreForQuestion [private]
 

System.Windows.Forms.GroupBox PapaganEgitim::GameInterface::currentScoreGroupBox [private]
 

System.Windows.Forms.Label PapaganEgitim::GameInterface::currentScoreLabel [private]
 

System.Windows.Forms.GroupBox PapaganEgitim::GameInterface::currentTotalScoreGroupBox [private]
 

System.Windows.Forms.Label PapaganEgitim::GameInterface::currentTotalScoreLabel [private]
 

String PapaganEgitim::GameInterface::currentWord [private]
 

int PapaganEgitim::GameInterface::currentWordId [private]
 

AxShockwaveFlashObjects.AxShockwaveFlash PapaganEgitim::GameInterface::flashWindow [private]
 

System.Windows.Forms.GroupBox PapaganEgitim::GameInterface::hintGroupBox [private]
 

System.Windows.Forms.Label PapaganEgitim::GameInterface::hintLabel [private]
 

int PapaganEgitim::GameInterface::secondsLeft [private]
 

System.Timers.Timer PapaganEgitim::GameInterface::timer [private]
 

System.Windows.Forms.GroupBox PapaganEgitim::GameInterface::timerGroupBox [private]
 

System.Windows.Forms.Label PapaganEgitim::GameInterface::timerLabel [private]
 


The documentation for this class was generated from the following file:
Generated on Mon May 29 01:05:01 2006 for PAPAGAN by  doxygen 1.4.6-NO