Beispiel #1
0
 /// <summary>
 /// Constructor. Takes the SubsystemResource to duplicate. This does not copy the listener.
 /// </summary>
 /// <param name="toDuplicate">Enter the contents of this SubystemResource into the new one.</param>
 /// <param name="live">True to also hook up the source subsystem resources listener. If you are setting this to true
 /// it is reccomended that there not actually be any resources in the ResourceManager.</param>
 internal SubsystemResources(SubsystemResources toDuplicate, bool live)
 {
     this.name = toDuplicate.name;
     foreach (ResourceGroup group in toDuplicate.resourceGroups.Values)
     {
         this.addResourceGroup(new ResourceGroup(group, this));
     }
     //We do the live hookup last since this is a clone and if there are resources, the subsystems already know about them.
     if (live)
     {
         this.listener = toDuplicate.listener;
     }
 }
Beispiel #2
0
        /// <summary>
        /// Create a resource manager with one subsystem specified by customSubsystemName using the passed listener. This
        /// does not have any relation to the live and scratch resource managers.
        /// </summary>
        /// <param name="customSubsystemName"></param>
        /// <param name="listener"></param>
        /// <returns></returns>
        public ResourceManager createResourceManagerForListener(String customSubsystemName, ResourceListener listener)
        {
            ResourceManager resourceManager = new ResourceManager();

            resourceManager.addSubsystemResource(new SubsystemResources(customSubsystemName, listener));
            return(resourceManager);
        }
Beispiel #3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="name">The name of the subsystem this provides resources for.</param>
 /// <param name="listener">The ResourceListener attached to this subsystem. This can be null and will never be copied if the copy constructor is used.</param>
 internal SubsystemResources(String name, ResourceListener listener)
 {
     this.name     = name;
     this.listener = listener;
 }
Beispiel #4
0
 /// <summary>
 /// Add a set of SubsystemResources to the primary ResourceManager. This
 /// will allow a plugin to get updates about the resources that are
 /// requested for a scene. The SubsystemResources passed to this
 /// function should be configured with a ResourceListener so it can get
 /// the appropriate callbacks.
 /// </summary>
 /// <param name="subsystem">A callback configured SubsystemResources instance.</param>
 public void addSubsystemResources(String name, ResourceListener subsystemListener)
 {
     prototypeResourceManager.addSubsystemResource(new SubsystemResources(name, subsystemListener));
 }