Ignore:
Timestamp:
02/25/11 14:59:27 (8 years ago)
Author:
beliar
Message:

Ticket #305: Patch by beliar.
Additions to the public interface of the CharacterCreationController? class:

  • Added read-only properties for name, age, gender, origin and picture.
  • Added getStatisticValue method to get the value of a primary or secondary statistic.

Note that these do not return the actual value at the moment, as there are no values stored yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/active/character_customization/game/parpg/charactercreationcontroller.py

    r736 r745  
    6666           @return: None""" 
    6767        self.view.hide() 
    68  
     68         
     69    @property 
     70    def name(self): 
     71        """Returns the name of the character. 
     72        @return: Name of the character""" 
     73        #TODO: Replace once an actual value is stored 
     74        return "" 
     75     
     76    @property 
     77    def age(self): 
     78        """Returns the age of the character. 
     79        @return: Age of the character""" 
     80        #TODO: Replace once an actual value is stored 
     81        return 0 
     82     
     83    @property 
     84    def gender(self): 
     85        """Returns the gender of the character. 
     86        @return: Gender of the character""" 
     87        #TODO: Replace once an actual value is stored 
     88        return "" 
     89     
     90    @property 
     91    def origin(self): 
     92        """Returns the origin of the character. 
     93        @return: Origin of the character""" 
     94        #TODO: Replace once an actual value is stored 
     95        return "" 
     96     
     97    @property 
     98    def picture(self): 
     99        """Returns the ID of the current picture of the character.""" 
     100        #TODO: Replace once an actual value is stored 
     101        return ""  
     102     
    69103    def increaseStatistic(self, statistic): 
    70104        """Increases the given statistic by one. 
     
    75109     
    76110    def canIncreaseStatistic(self, statistic): 
    77         """Checks whether the given statistic can be increased or not 
     111        """Checks whether the given statistic can be increased or not. 
    78112        @param statistic: Name of the statistic to check 
    79113        @type statistic: string 
     
    90124     
    91125    def canDecreaseStatistic(self, statistic): 
    92         """Checks whether the given statistic can be decreased or not 
     126        """Checks whether the given statistic can be decreased or not. 
    93127        @param statistic: Name of the statistic to check 
    94128        @type statistic: string 
     
    96130        #TODO: Add Code 
    97131        return False 
    98  
     132     
     133    def getStatisticValue(self, statistic): 
     134        """Returns the value of the given statistic. 
     135        @param statistic: Name of the primary or secondary statistic 
     136        @type statistic: string 
     137        @return: Value of the given statistic""" 
     138        #TODO: Add Code 
     139        return 0 
     140     
    99141    def setName(self, name): 
    100142        """Sets the name of the character to the given value. 
Note: See TracChangeset for help on using the changeset viewer.