Axiom.Core.ResourceManager._add C# (CSharp) Method

_add() protected method

Add a newly created resource to the manager
protected _add ( Resource res ) : void
res Resource
return void
		protected virtual void _add( Resource res )
		{
			if ( !_resources.ContainsKey( res.Name ) )
			{
				_resources.Add( res.Name, res );
			}
			else
			{
				throw new AxiomException( String.Format( "Resource with the name {0} already exists.", res.Name ) );
			}

			if ( !_resourceHandleMap.ContainsKey( res.Handle ) )
			{
				_resourceHandleMap.Add( res.Handle, res );
			}
			else
			{
				throw new AxiomException( String.Format( "Resource with the handle {0} already exists.", res.Handle ) );
			}
		}