Ignore:
Timestamp:
02/03/10 13:21:45 (10 years ago)
Author:
maximinus_parpg
Message:

More clean up of the code.
Finshed first pass.
So should be at least stands compliant.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/objects/base.py

    r473 r477  
    5151           super(TinCan,self).__init__ (*args, **kwargs) 
    5252           self.name = 'Tin Can'""" 
     53            
    5354from fife import fife 
    5455from settings import Setting 
     
    6061    def __init__ (self, name="Dynamic object", **kwargs): 
    6162        """Initialise minimalistic set of data 
    62         @type name: String 
    63         @param name: Object display name 
    64         """ 
     63           @type name: String 
     64           @param name: Object display name""" 
    6565        self.name = name 
    6666 
     
    122122class Openable(object): 
    123123    """Adds open() and .close() capabilities to game objects 
    124     The current state is tracked by the .is_open variable""" 
     124       The current state is tracked by the .is_open variable""" 
    125125    def __init__(self, is_open = True, **kwargs): 
    126126        """Init operation for openable objects 
    127         @type is_open: Boolean 
    128         @param is_open: Keyword boolean argument sets the initial state.""" 
     127           @type is_open: Boolean 
     128           @param is_open: Keyword boolean argument sets the initial state.""" 
    129129        self.is_openable = True 
    130130        self.is_open = is_open 
     
    152152    def __init__ (self, locked = False, is_open = True, **kwargs): 
    153153        """Init operation for lockable objects 
    154         @type locked: Boolean 
    155         @param locked: Keyword boolen argument to set the initial locked state. 
    156         @type is_open: Boolean 
    157         @param is_open: Keyword boolean argument sets the initial open state. It is ignored if locked is True -- locked objects are always closed. 
    158         """ 
     154           @type locked: Boolean 
     155           @param locked: Keyword boolen argument sets the initial locked state. 
     156           @type is_open: Boolean 
     157           @param is_open: Keyword boolean argument sets the initial open state. 
     158                           It is ignored if locked is True -- locked objects 
     159                           are always closed.""" 
    159160        self.is_lockable = True 
    160         if locked == True: #HACK: For some reason locked appears to NOT be a bool. Needs investigation 
     161        # HACK: For some reason locked appears to NOT be a bool??? 
     162        # TODO: fix this, if only for our sanity! 
     163        if locked == True: 
    161164            locked = True 
    162165        else: locked = False 
     
    191194 
    192195    def getInventoryThumbnail(self): 
    193         #TODO: Implement properly after the objects database is in place 
     196        # TODO: Implement properly after the objects database is in place 
    194197        return "gui/inv_images/inv_litem.png" 
    195198     
     
    270273 
    271274    def findItem(self, **kwargs): 
    272         """Find an item in container by various attributes. All parameters are optional. 
     275        """Find an item in container by attributes. All params are optional. 
    273276           @type name: String 
    274            @param name: Unique or non-unique object name. If the name is non-unique, first matching object is returned 
     277           @param name: If the name is non-unique, return first matching object 
    275278           @type kind: String 
    276            @param kind: One of the possible object kinds like "openable" or "weapon" 
    277            @return: The item matching criteria or None if none was found 
    278         """ 
     279           @param kind: One of the possible object types 
     280           @return: The item matching criteria or None if none was found""" 
    279281        for i in self.items : 
    280282            if "name" in kwargs and self.items[i].name != kwargs["name"]: 
     
    288290    def __init__ (self, **kwargs): 
    289291        self.is_living = True 
     292 
    290293    def die(self): 
    291294        self.is_living = False 
Note: See TracChangeset for help on using the changeset viewer.