source: nrEngine/include/ScriptLoader.h @ 35

Revision 35, 2.8 KB checked in by art, 12 years ago (diff)

Big changes in resource managment system. Interface functions were renamed.
Resource loading is now done throughthe resource and not through the loader.

Line 
1/***************************************************************************
2 *                                                                         *
3 *   (c) Art Tevs, MPI Informatik Saarbruecken                             *
4 *       mailto: <tevs@mpi-sb.mpg.de>                                      *
5 *                                                                         *
6 *   This program is free software; you can redistribute it and/or modify  *
7 *   it under the terms of the GNU General Public License as published by  *
8 *   the Free Software Foundation; either version 2 of the License, or     *
9 *   (at your option) any later version.                                   *
10 *                                                                         *
11 ***************************************************************************/
12
13
14#ifndef _NR_SCRIPT_RESOURCE_LOADER_H_
15#define _NR_SCRIPT_RESOURCE_LOADER_H_
16
17//----------------------------------------------------------------------------------
18// Includes
19//----------------------------------------------------------------------------------
20#include "Prerequisities.h"
21#include "ResourceLoader.h"
22#include "IScript.h"
23#include "Script.h"
24
25namespace nrEngine{
26       
27        //! Script loader is used to create/load engine's script objects
28        /**
29        * Scriptloader is used to load standard scripts based on the engine's language.
30        * Standard scripts are very simple and at the time they can only be used
31        * to load other script languages having more functionality.
32        *
33        * @see IResourceLoader
34        * \ingroup script
35        **/
36        class _NRExport ScriptLoader : public IResourceLoader{
37                public:
38                               
39                        /**
40                        * Declare supported resource types and supported files.
41                        **/
42                        ScriptLoader();
43                       
44                        /**
45                        * Destructor
46                        **/
47                        ~ScriptLoader();
48               
49                private:
50                        /**
51                         * Initialize supported resource and file types for the resource script
52                         **/
53                        Result initializeResourceLoader();
54                       
55                        /**
56                        * Load the script resource.
57                        *
58                        * If a script is loaded then it will be added to the kernel as a task,
59                        * because scripts are task executed in the kernel.
60                        * If you write your own script-loader (i.e. different script language),
61                        * so you have to worry about the adding the script into the kernel .
62                        **/
63                        Result loadResource(IResource* res, const std::string& fileName, PropertyList* param = NULL);
64       
65                        /**
66                        * Create an empty script resource. The resource represents a script
67                        * which does have no effect.
68                        *
69                        * @param resourceType Unique name of the resource type to be created
70                        * @return Instance of empty resource
71                        **/
72                        IResource* createEmptyResource(const std::string& resourceType);
73                       
74                        /**
75                        * @see IResourceLoader::createResourceImpl()
76                        **/
77                        IResource* createResource(const std::string& resourceType, PropertyList* params = NULL);
78                       
79        };
80
81};
82
83#endif
Note: See TracBrowser for help on using the repository browser.