public void removeMovableObjectFactory(MovableObjectFactory fact) { OgrePINVOKE.Root_removeMovableObjectFactory(swigCPtr, MovableObjectFactory.getCPtr(fact)); if (OgrePINVOKE.SWIGPendingException.Pending) { throw OgrePINVOKE.SWIGPendingException.Retrieve(); } }
public void addMovableObjectFactory(MovableObjectFactory fact, bool overrideExisting) { OgrePINVOKE.Root_addMovableObjectFactory__SWIG_0(swigCPtr, MovableObjectFactory.getCPtr(fact), overrideExisting); if (OgrePINVOKE.SWIGPendingException.Pending) { throw OgrePINVOKE.SWIGPendingException.Retrieve(); } }
public virtual void _notifyCreator(MovableObjectFactory fact) { OgrePINVOKE.MovableObject__notifyCreator(swigCPtr, MovableObjectFactory.getCPtr(fact)); if (OgrePINVOKE.SWIGPendingException.Pending) { throw OgrePINVOKE.SWIGPendingException.Retrieve(); } }
public MovableObjectFactory getMovableObjectFactory(string typeName) { global::System.IntPtr cPtr = OgrePINVOKE.Root_getMovableObjectFactory(swigCPtr, typeName); MovableObjectFactory ret = (cPtr == global::System.IntPtr.Zero) ? null : new MovableObjectFactory(cPtr, false); if (OgrePINVOKE.SWIGPendingException.Pending) { throw OgrePINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public MovableObjectFactory _getCreator() { global::System.IntPtr cPtr = OgrePINVOKE.MovableObject__getCreator(swigCPtr); MovableObjectFactory ret = (cPtr == global::System.IntPtr.Zero) ? null : new MovableObjectFactory(cPtr, false); if (OgrePINVOKE.SWIGPendingException.Pending) { throw OgrePINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(MovableObjectFactory obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
/// <summary> /// Register a new MovableObjectFactory which will create new MovableObject /// instances of a particular type, as identified by the Type property. /// </summary> /// <remarks> /// Plugin creators can create subclasses of MovableObjectFactory which /// construct custom subclasses of MovableObject for insertion in the /// scene. This is the primary way that plugins can make custom objects /// available. /// </remarks> /// <param name="fact"> /// The factory instance. /// </param> /// <param name="overrideExisting"> /// Set this to true to override any existing /// factories which are registered for the same type. You should only /// change this if you are very sure you know what you're doing. /// </param> public void AddMovableObjectFactory( MovableObjectFactory fact, bool overrideExisting ) { if ( this.movableObjectFactoryMap.ContainsKey( fact.Type ) && !overrideExisting ) { throw new AxiomException( "A factory of type '" + fact.Type + "' already exists." ); } if ( fact.RequestTypeFlags ) { if ( this.movableObjectFactoryMap.ContainsValue( fact ) ) { // Copy type flags from the factory we're replacing fact.TypeFlag = ( this.movableObjectFactoryMap[ fact.Type ] ).TypeFlag; } else { // Allocate new fact.TypeFlag = NextMovableObjectTypeFlag(); } } // Save if ( this.movableObjectFactoryMap.ContainsKey( fact.Type ) ) { LogManager.Instance.Write( "Factory {0} has been replaced by {1}.", this.movableObjectFactoryMap[ fact.Type ].GetType().Name, fact.GetType().Name ); this.movableObjectFactoryMap[ fact.Type ] = fact; } else { this.movableObjectFactoryMap.Add( fact.Type, fact ); } LogManager.Instance.Write( "Factory " + fact.GetType().Name + " registered for MovableObjectType '" + fact.Type + "'." ); }
/// <summary> /// Removes a previously registered MovableObjectFactory. /// </summary> /// <remarks> /// All instances of objects created by this factory will be destroyed /// before removing the factory (by calling back the factories /// 'DestroyInstance' method). The plugin writer is responsible for actually /// destroying the factory. /// </remarks> /// <param name="fact">The instance to remove.</param> public void RemoveMovableObjectFactory( MovableObjectFactory fact ) { if ( this.movableObjectFactoryMap.ContainsValue( fact ) ) { this.movableObjectFactoryMap.Remove( fact.Type ); } }