/Aurora/Framework/Modules/IRegionModuleBase.cs
C# | 101 lines | 16 code | 8 blank | 77 comment | 0 complexity | bfd4b79c4f6078c35a8c84cd312fa96a MD5 | raw file
1/* 2 * Copyright (c) Contributors, http://aurora-sim.org/, http://opensimulator.org/ 3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * * Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * * Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * * Neither the name of the Aurora-Sim Project nor the 13 * names of its contributors may be used to endorse or promote products 14 * derived from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28using System; 29using Aurora.Framework.SceneInfo; 30using Nini.Config; 31 32namespace Aurora.Framework.Modules 33{ 34 public interface IRegionModuleBase 35 { 36 /// <value> 37 /// The name of the module 38 /// </value> 39 string Name { get; } 40 41 /// <summary> 42 /// If this returns non-null, it is the type of an interface that 43 /// this module intends to register. 44 /// This will cause the loader to defer loading of this module 45 /// until all other modules have been loaded. If no other module 46 /// has registered the interface by then, this module will be 47 /// activated, else it will remain inactive, letting the other module 48 /// take over. This should return non-null ONLY in modules that are 49 /// intended to be easily replaceable, e.g. stub implementations 50 /// that the developer expects to be replaced by third party provided 51 /// modules. 52 /// </summary> 53 Type ReplaceableInterface { get; } 54 55 /// <summary> 56 /// This is called to initialize the region module. For shared modules, this is called 57 /// exactly once, after creating the single (shared) instance. For non-shared modules, 58 /// this is called once on each instance, after the instace for the region has been created. 59 /// </summary> 60 /// <param name="source"> 61 /// A <see cref="IConfigSource" /> 62 /// </param> 63 void Initialise(IConfigSource source); 64 65 /// <summary> 66 /// This is called whenever a <see cref="IScene" /> is added. For shared modules, this can happen several times. 67 /// For non-shared modules, this happens exactly once, after <see cref="Initialise" /> has been called. 68 /// </summary> 69 /// <param name="scene"> 70 /// A <see cref="IScene" /> 71 /// </param> 72 void AddRegion(IScene scene); 73 74 /// <summary> 75 /// This will be called once for every scene loaded. In a shared module 76 /// this will be multiple times in one instance, while a nonshared 77 /// module instance will only be called once. 78 /// This method is called after AddRegion has been called in all 79 /// modules for that scene, providing an opportunity to request 80 /// another module's interface, or hook an event from another module. 81 /// </summary> 82 /// <param name="scene"> 83 /// A <see cref="IScene" /> 84 /// </param> 85 void RegionLoaded(IScene scene); 86 87 /// <summary> 88 /// This is called whenever a <see cref="IScene" /> is removed. For shared modules, this can happen several times. 89 /// For non-shared modules, this happens exactly once, if the scene this instance is associated with is removed. 90 /// </summary> 91 /// <param name="scene"> 92 /// A <see cref="IScene" /> 93 /// </param> 94 void RemoveRegion(IScene scene); 95 96 /// <summary> 97 /// This is the inverse to <see cref="Initialise" />. After a Close(), this instance won't be usable anymore. 98 /// </summary> 99 void Close(); 100 } 101}