Ignore:
Timestamp:
03/16/10 18:13:46 (10 years ago)
Author:
beliar
Message:

Changes according to our coding standards

File:
1 edited

Legend:

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

    r478 r529  
    2929 
    3030class WoodenCrate (ImmovableContainer): 
    31     def __init__ (self, ID, name = 'Wooden Crate', 
    32                   text = 'A battered crate', gfx = 'crate', **kwargs): 
    33         ImmovableContainer.__init__(self, ID = ID, name = name, gfx = gfx, \ 
    34                 text = text, **kwargs) 
    35         self.placeItem(CarryableItem(ID=987,name="Dagger456")) 
     31    def __init__(self, object_id, name = 'Wooden Crate', 
     32                 text = 'A battered crate', gfx = 'crate', **kwargs): 
     33        ImmovableContainer.__init__(self, ID = object_id, name = name,  
     34                                    gfx = gfx, text = text, **kwargs) 
     35        self.placeItem(CarryableItem(ID=987, name="Dagger456")) 
    3636         
    3737class ContainerBehaviour(fife.InstanceActionListener): 
     
    4343        self.agent = None 
    4444 
    45     def attachToLayer(self, agent_ID): 
     45    def attachToLayer(self, agent_id): 
    4646        """ Attaches to a certain layer 
    47             @type agent_ID: String 
    48             @param agent_ID: ID of the layer to attach to. 
     47            @type agent_id: String 
     48            @param agent_id: ID of the layer to attach to. 
    4949            @return: None""" 
    50         self.agent = self.layer.getInstance(agent_ID) 
     50        self.agent = self.layer.getInstance(agent_id) 
    5151        self.agent.addActionListener(self) 
    5252        self.state = _AGENT_STATE_CLOSED 
     
    7070         
    7171    def open (self): 
    72         if self.state != _AGENT_STATE_OPENED and self.state != _AGENT_STATE_OPENING: 
     72        if self.state != _AGENT_STATE_OPENED and self.state != \ 
     73                                                _AGENT_STATE_OPENING: 
    7374            self.agent.act('open', self.agent.getLocation()) 
    7475            self.state = _AGENT_STATE_OPENING 
    7576 
    7677    def close(self): 
    77         if self.state != _AGENT_STATE_CLOSED and self.state != _AGENT_STATE_CLOSING: 
     78        if self.state != _AGENT_STATE_CLOSED and self.state != \ 
     79                                                _AGENT_STATE_CLOSING: 
    7880            self.agent.act('close', self.agent.getLocation()) 
    7981            self.state = _AGENT_STATE_CLOSING   
    8082     
    8183class Footlocker(ImmovableContainer): 
    82     def __init__ (self, ID, agent_layer=None, name = 'Footlocker', 
     84    def __init__ (self, object_id, agent_layer=None, name = 'Footlocker', 
    8385                  text = 'A Footlocker', gfx = 'lock_box_metal01', **kwargs): 
    84         ImmovableContainer.__init__(self, ID = ID, name = name, gfx = gfx, 
    85                                     text = text, **kwargs) 
    86         self.placeItem(CarryableItem(ID=987,name="Dagger456")) 
     86        ImmovableContainer.__init__(self, ID = object_id, name = name,  
     87                                    gfx = gfx, text = text, **kwargs) 
     88        self.behaviour = None 
     89        self.placeItem(CarryableItem(ID=987, name="Dagger456")) 
    8790 
    8891        self.is_AnimatedContainer = True 
     
    9295        odict = self.__dict__.copy() 
    9396        del odict["behaviour"] 
    94         return odict; 
     97        return odict 
    9598     
    9699    def __setstate__(self, state): 
     
    105108 
    106109    def open (self): 
    107         super (Footlocker,self).open() 
     110        super (Footlocker, self).open() 
    108111        self.behaviour.open() 
    109112 
    110113    def close(self): 
    111         super (Footlocker,self).close() 
     114        super (Footlocker, self).close() 
    112115        self.behaviour.close() 
Note: See TracChangeset for help on using the changeset viewer.