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 |
|
|
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. |
|
||||||||||||
|
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. |
|
||||||||||||
|
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. |
|
|
Clean up any resources being used.
|
|
|
A get function for accessing current answer.
|
|
|
A get function for accessing current right answers initial letter.
|
|
|
A get function for accessing current questions score.
|
|
|
A get function for accessing current total score.
|
|
|
A get function for accessing the answer given.
|
|
|
A get function for accessing current word id.
|
|
|
A get function for asking the seconds left.
|
|
|
A get function for accessing the private timer object.
|
|
|
Makes the GUI definition.
|
|
||||||||||||
|
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. |
|
|
A set function for filling current answer variable.
|
|
|
A set function for filling current answers initial letter variable.
|
|
|
A set function for setting the current.
|
|
|
A set function for keeping the over current total score.
|
|
|
A set function for storing the answer given.
|
|
|
A set function for updating current word id.
|
|
|
A set function for renewing the value for seconds left.
|
|
|
Enables timed event mechanism and fills our variable for timing. |
|
||||||||||||
|
updates the desired labels Given string is updated and the new value is the second argument.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.4.6-NO