コード例 #1
0
		/// <summary>
		///		Internal method for finding &amp; invoking an attribute parser.
		/// </summary>
		/// <param name="line"></param>
		/// <param name="parsers"></param>
		/// <returns></returns>
		protected bool InvokeParser( string line, AxiomCollection<MethodInfo> parsers )
		{
			string[] splitCmd = StringConverter.Split( line, new char[] { ' ', '\t' }, 2 );

			// find attribute parser
			if ( parsers.ContainsKey( splitCmd[ 0 ] ) )
			{
				string cmd = string.Empty;

				if ( splitCmd.Length >= 2 )
				{
					cmd = splitCmd[ 1 ];
				}

				//MaterialAttributeParserHandler handler = (MaterialAttributeParserHandler)parsers[ splitCmd[ 0 ] ];
				MethodInfo handler = (MethodInfo)parsers[ splitCmd[ 0 ] ];

				// Use parser, make sure we have 2 params before using splitCmd[1]
				// MONO: Does not like mangling the above and below lines into a single line (frankly, i don't blame it, but csc takes it).
				// i.e. (((MaterialAttributeParserHandler)parsers[splitCmd[0]]))(cmd, scriptContext);
				//return handler( cmd, scriptContext );
				return (bool)handler.Invoke( null, new object[] { cmd, scriptContext } );
			}
			else
			{
				// BAD command, BAD!!
				LogParseError( scriptContext, "Unrecognized command: {0}", splitCmd[ 0 ] );
				return false;
			}
		}
コード例 #2
0
 public Enumerator(AxiomCollection list)
 {
     this.list = list;
 }
コード例 #3
0
 public AxiomCollection(AxiomCollection <int> copy)
     : base((IDictionary <string, T>)copy)
 {
 }
コード例 #4
0
		/// <summary>
		///		Copies the values of all constants (including auto constants) from another <see cref="GpuProgramParameters"/> object.
		/// </summary>
		/// <param name="source">Set of params to use as the source.</param>
		public void CopyConstantsFrom( GpuProgramParameters source )
		{
			int i = 0;

			FloatConstantEntry[] floatEntries = new FloatConstantEntry[ source.floatConstants.Count ];
			IntConstantEntry[] intEntries = new IntConstantEntry[ source.intConstants.Count ];

			// copy those float and int constants right on in
			source.floatConstants.CopyTo( floatEntries );
			source.intConstants.CopyTo( intEntries );

			floatConstants.AddRange( floatEntries );
			intConstants.AddRange( intEntries );

			// Iterate over auto parameters
			// Clear existing auto constants
			ClearAutoConstantType();

			for ( i = 0; i < source.autoConstantList.Count; i++ )
			{
				AutoConstantEntry entry = (AutoConstantEntry)source.autoConstantList[ i ];
				SetAutoConstant( entry.Clone() );
			}

			// don't forget to copy the named param lookup as well
			namedParams = new AxiomCollection<int>( source.namedParams );
		}
コード例 #5
0
 public Enumerator(AxiomCollection list)
 {
     this.list = list;
 }