Changeset 68


Ignore:
Timestamp:
16/04/07 15:54:44 (6 years ago)
Author:
guyru
Message:

more documantation to the code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/OpenYahtzee/src/MainFrame.cpp

    r67 r68  
    350350 * of a technical problem relating to the case an high-score was made and then 
    351351 * the user undo the last move and rescore another high-score and so on. 
    352  * @param event  
     352 * \param event  
    353353 */ 
    354354void MainFrame::OnUndo(wxCommandEvent& event) 
     
    389389        m_numofplaysleft++; 
    390390} 
    391 ///This function enables the undo button and stores the last move 
     391 
     392/** 
     393 * This function enables the undo button and stores the last move 
     394 * \param id  
     395 */ 
    392396inline void MainFrame::EnableUndo(int id) 
    393397{ 
     
    398402} 
    399403 
     404/** 
     405 * Shows the high-score dialog. Connected to the Game->"Show High Score" menu item. 
     406 * \param event  
     407 */ 
    400408void MainFrame::OnShowHighscore(wxCommandEvent& event) 
    401409{ 
     
    404412} 
    405413 
     414/** 
     415 * Shows the settings dialog. This event-handler is connected to Game->Settings 
     416 * menu item. 
     417 * \param event  
     418 */ 
    406419void MainFrame::OnSettings( wxCommandEvent& event) 
    407420{ 
     
    447460} 
    448461 
     462/** 
     463 * Event handler for the Roll button. It checks the settings if it should 
     464 * animate the dice and then rolls them accordingly. It also checks for the 
     465 * status of the "keep" checkboxes. 
     466 * \param event  
     467 */ 
    449468void MainFrame::OnRollButton (wxCommandEvent& event) 
    450469{ 
     
    498517} 
    499518 
     519/** 
     520 * This is the event-handler for all of the scoring buttons of the upper section. 
     521 * 
     522 * It gets the id of the button that called the event handler by comparing it  
     523 * to the id of the aces button it figures what button was pressed, And updates 
     524 * the suiting score textbox (again by comparing the id to the one of the aces 
     525 * checbox). 
     526 * \param event  
     527 */ 
    500528void MainFrame::OnUpperButtons (wxCommandEvent& event) 
    501529{ 
     
    515543} 
    516544 
     545/** 
     546 * Event handler for the "3 of a kind" score button. 
     547 * \param event  
     548 */ 
    517549void MainFrame::On3ofakindButton(wxCommandEvent& event) 
    518550{ 
     
    542574} 
    543575 
     576/** 
     577 * Event handler for the "4 of a kind" score button. 
     578 * \param event  
     579 */ 
    544580void MainFrame::On4ofakindButton(wxCommandEvent& event) 
    545581{ 
     
    569605} 
    570606 
     607/** 
     608 * Event handler for the full-house score button. 
     609 * \param event  
     610 */ 
    571611void MainFrame::OnFullHouseButton(wxCommandEvent& event) 
    572612{ 
     
    594634} 
    595635 
     636/** 
     637 * Event handler for the small-sequence score button. 
     638 * \param event  
     639 */ 
    596640void MainFrame::OnSmallSequenceButton(wxCommandEvent& event) 
    597641{ 
     
    616660} 
    617661 
     662/** 
     663 * Event handler for the large-sequence score button. 
     664 * \param event  
     665 */ 
    618666void MainFrame::OnLargeSequenceButton(wxCommandEvent& event) 
    619667{ 
     
    637685} 
    638686 
     687/** 
     688 * Event handler for the yahtzee score button. 
     689 * \param event  
     690 */ 
    639691void MainFrame::OnYahtzeeButton(wxCommandEvent& event) 
    640692{ 
     
    653705} 
    654706 
     707/** 
     708 * Evnet handler for the chance score button. 
     709 * \param event  
     710 */ 
    655711void MainFrame::OnChanceButton (wxCommandEvent& event) 
    656712{ 
     
    672728} 
    673729 
     730/** 
     731 * Event handler for mouse clicks on the dice. 
     732 * 
     733 * When clicking on the dice this event-handler ticks the appropriate "keep" checkbox. 
     734 * \param event  
     735 */ 
    674736void MainFrame::OnDiceClick (wxCommandEvent& event) 
    675737{ 
     
    684746//******************************************** 
    685747 
     748/** 
     749 * This function clears the dice hash. 
     750 * 
     751 * The dice hash is just an array that holds how many dices have each value. 
     752 */ 
    686753void MainFrame::ClearDiceHash() 
    687754{ 
     
    690757} 
    691758 
     759/** 
     760 * This function handles everything related to reseting the dice rolls after scoring. 
     761 */ 
    692762void MainFrame::ResetRolls() 
    693763{ 
     
    701771} 
    702772 
     773/** 
     774 * This function checks for a Yahtzee Bonus situation and if one exists it scores accordingly. 
     775 */ 
    703776void MainFrame::YahtzeeBonus() 
    704777{ 
     
    719792} 
    720793 
     794/** 
     795 * This function checks whether we have a Yahtzee Joker situation. 
     796 * \return true if there is Yahtzee Joker, false otherwise. 
     797 */ 
    721798bool MainFrame::YahtzeeJoker() 
    722799{ 
     
    727804} 
    728805 
     806/** 
     807 * This function handles the end of game. 
     808 * 
     809 * When a game ends it calculates the total score and submit it to the high 
     810 * score list. 
     811 */ 
    729812void MainFrame::EndofGame() 
    730813{ 
     
    779862} 
    780863 
     864/** 
     865 * This function checks if a given score qualifies for the high score list and 
     866 * adds it to the list if it does. 
     867 * @param score The score submitted to the high score list. 
     868 */ 
    781869void MainFrame::HighScoreHandler(int score) 
    782870{ 
     
    811899 
    812900///this function handles all the post scoring stuff such as disabling the right button. 
     901/** 
     902 * This function is always called after scoring and it handles all the post-score 
     903 * stuff such as reseting the dice rolls, enabling the undo button, calculating 
     904 * the sub-total scores and ending the game if necessary. 
     905 * \param id  
     906 */ 
    813907void MainFrame::PostScore(int id) 
    814908{ 
     
    825919} 
    826920 
     921/** 
     922 * This function calculates the sub-total scores and should be called after 
     923 * every score. It does so only if this feature is requested in the settings 
     924 * dialog. 
     925 */ 
    827926void MainFrame::CalculateSubTotal() 
    828927{ 
     
    854953} 
    855954 
     955/** 
     956 * This function launches the default browser and directs it to a given url. 
     957 * 
     958 * This function extends the wxWidgets default function for this job by checking manually for 
     959 * different browsers if the wxWidgets' function doesn't find one. This is usually necessary  
     960 * under linux when epiphany isn't installed for some unknown reason. 
     961 * @param link The url that the browser will go to when it stats. 
     962 */ 
    856963void MainFrame::LaunchBrowser (wxString link){ 
    857964        if (!wxLaunchDefaultBrowser(link)){ 
Note: See TracChangeset for help on using the changeset viewer.