Changeset 176


Ignore:
Timestamp:
07/01/09 19:47:59 (10 years ago)
Author:
tie_parpg
Message:
  • added an all definition to the containers.py module
  • added a getAllObjects() function to init.py to facilitate game object creation
Location:
trunk/PARPG/scripts/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/scripts/objects/__init__.py

    r164 r176  
     1#!/usr/bin/python 
     2 
     3#   This file is part of PARPG. 
     4 
     5#   PARPG is free software: you can redistribute it and/or modify 
     6#   it under the terms of the GNU General Public License as published by 
     7#   the Free Software Foundation, either version 3 of the License, or 
     8#   (at your option) any later version. 
     9 
     10#   PARPG is distributed in the hope that it will be useful, 
     11#   but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13#   GNU General Public License for more details. 
     14 
     15#   You should have received a copy of the GNU General Public License 
     16#   along with PARPG.  If not, see <http://www.gnu.org/licenses/>. 
     17import containers 
     18 
     19object_modules = [containers,] 
     20 
     21def getAllObjects (): 
     22    """Returns a dictionary with the names of the concrete game object classes 
     23    mapped to the classes themselves""" 
     24    result = {} 
     25    for module in object_modules: 
     26        for class_name in module.__all__: 
     27            result[class_name] = getattr (module,class_name) 
     28             
     29    return result 
  • trunk/PARPG/scripts/objects/containers.py

    r166 r176  
    1919barrels, chests, etc.""" 
    2020 
     21__all__ = ["WoodenCrate",] 
     22 
    2123import composed 
    2224 
Note: See TracChangeset for help on using the changeset viewer.