URL:
  <http://gna.org/patch/?3307>

                 Summary: bug fix for #19513 : Incorect string in hotkeys
dialog. (second version)
                 Project: Battle for Wesnoth
            Submitted by: lovcapone
            Submitted on: mar. 22 mai 2012 06:40:47 GMT
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

In this patch, the design patterns "State" and "Factory Method" were used to
fix bug #19513. As I understand, the issue was that some hot keys'
descriptions were used in different situations. For some hot keys, the
description had to be altered based on the given situation.

So the solution is that in the hotkey_item::get_description method, a
"context" object (wich has different "states") is used to create a description
string based on the situation in wich this method is called. The "states" is
essentially a "factory method" where the "product" is the string that has to
be created.

The hotkey_item::get_description method had to be modifed to accept
2 parameters but thanks to default parameters, most of the existing
code wasn't modified.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: mar. 22 mai 2012 06:40:47 GMT  Name: Bug_19513_Fix.diff  Size: 14 ko  
By: lovcapone

<http://gna.org/patch/download.php?file_id=15766>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?3307>

_______________________________________________
  Message posté via/par Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to