コード例 #1
0
ファイル: Root.cs プロジェクト: wellsanin1/Game-Engine
 public void removeMovableObjectFactory(MovableObjectFactory fact)
 {
     OgrePINVOKE.Root_removeMovableObjectFactory(swigCPtr, MovableObjectFactory.getCPtr(fact));
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #2
0
ファイル: Root.cs プロジェクト: wellsanin1/Game-Engine
 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();
     }
 }
コード例 #3
0
 public virtual void _notifyCreator(MovableObjectFactory fact)
 {
     OgrePINVOKE.MovableObject__notifyCreator(swigCPtr, MovableObjectFactory.getCPtr(fact));
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #4
0
ファイル: Root.cs プロジェクト: wellsanin1/Game-Engine
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 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);
 }
コード例 #7
0
ファイル: Root.cs プロジェクト: ryan-bunker/axiom3d
		/// <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 +
			                           "'." );
		}
コード例 #8
0
ファイル: Root.cs プロジェクト: ryan-bunker/axiom3d
		/// <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 );
			}
		}