gcavalcante8808/CDC — pull request #2 by gcavalcante8808 (2014-07-02 22:54:19+00:00)
Title: New refactored version - Combat Field feature will be missing.

This is a new completely refactored version of the softwares and represent mostly internal changes and 1 less features that will be reimplemented later.

# Changelog

### Refactoring and new features

#### Self.comba is gone

Instead, the following behaviours and resources are now in place:

* __Character class__: now, when we need to create a player character(PC) or a nonplayercharacter(NPC) we just get a new instance from Character Class, as the following:

`a = Character()`

* __Character attributes__: the Character attributes now holds all the information needed for a character: name, level, hp, init_value, ammo, char_type (0 for PC, 1 for NPC), size, errors (for internal use only, will be used in the future to hold some tk error messages);

* __Character class attribute verification__: the character class have two methods (more will be done later :D):

* clean_int_fields provide a mechanism to verify if the value is an Integer (tkinter entries always return strings) and convert the value for integer.

* cleaned_data: verify if the essentials fields are filled with the right information (sometimes calling clean_int_fields method to clean fields).

* __An attribute that holds the list of characters created__: the self.chars inside MontyPython class now holds a list with all characters created.

#### ListBox selection and Character manipulation

Now, all operations that aims to get a specific character and syncronization with the listbox selection is done throught two internal methods (only available to MontyPython class methods):

* ___get_or_select_listbox_item__: An usefull method that try get to the selected item in the listbox. Have 2 additional behaviors:
* AutoSelect: if autoselect is true and the user haven't selected any of the items in the listbox, then the first will be selected. For now, just the shift turn action uses that function, for all other actions the users must select a character before run a action over it.
* Next Pos: if selected, returns and select the next item of the listbox. Actually, only usefull for the shift_turn method.

* Old methods refactored: sort, add_char, delete_char, change_initiative, shift_turn, add_status, add_hitpoints, subtract_hitpoints are now in place (take a look at the docstrings documentation for some more details).

#### New Add Status options and future behavior

Previously the add status just can receive the name of the status and his duration in turns; a new option called 'Type of Status' provides options for static/finite statuses (in number of turns) as well for especific duration statuses that needs a Resistance Test or some other condition to end.

In the future, the shift_action method will alarm about a condition and maybe manage the statuses (remove a specific status that reach a duration, etc).

A interface for delete statuses is still missing.

### BUGS Solved

* Previously if no file was selected in the file dialogs (save or open) the program keep running because the dialogs wasn't correctly destroyed. Now the program closes normally , even if the user haven't selected a file.

* Some PEP-8 fixes.

### Features Unavailable

The Combat Field feature (which is incredible usefull) will be reimplemented later considering its complexity.