Skip to content

Commit

Permalink
Added more comment blocks.
Browse files Browse the repository at this point in the history
Added more stubbed classes.
Added more interfaces.
  • Loading branch information
KonajuGames committed Jun 22, 2012
1 parent 10994e8 commit fb817b1
Show file tree
Hide file tree
Showing 12 changed files with 715 additions and 4 deletions.
117 changes: 117 additions & 0 deletions MonoGame.Framework.Content.Pipeline/ChildCollection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#region License
/*
Microsoft Public License (Ms-PL)
MonoGame - Copyright © 2012 The MonoGame Team
All rights reserved.
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not
accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under
U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software,
your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including
a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object
code form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees
or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent
permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular
purpose and non-infringement.
*/
#endregion License

using System;
using System.Collections.ObjectModel;

namespace Microsoft.Xna.Framework.Content.Pipeline
{
/// <summary>
/// Provides a collection of child objects for a content item.
///
/// Links from a child object to its parent are maintained as the collection contents are modified.
/// </summary>
/// <typeparam name="TParent"></typeparam>
/// <typeparam name="TChild"></typeparam>
public abstract class ChildCollection<TParent, TChild> : Collection<TChild>
where TParent : class
where TChild : class
{
/// <summary>
/// Creates an instance of ChildCollection.
/// </summary>
/// <param name="parent">Parent object of the child objects returned in the collection.</param>
protected ChildCollection(TParent parent)
{
throw new NotImplementedException();
}

/// <summary>
/// Removes all children from the collection.
/// </summary>
protected override void ClearItems()
{
throw new NotImplementedException();
}

/// <summary>
/// Gets the parent of a child object.
/// </summary>
/// <param name="child">The child of the parent being retrieved.</param>
/// <returns>The parent of the child object.</returns>
protected abstract TParent GetParent(TChild child);

/// <summary>
/// Inserts a child object into the collection at the specified location.
/// </summary>
/// <param name="index">The position in the collection.</param>
/// <param name="item">The child object being inserted.</param>
protected override void InsertItem(int index, TChild item)
{
throw new NotImplementedException();
}

/// <summary>
/// Removes a child object from the collection.
/// </summary>
/// <param name="index">The index of the item being removed.</param>
protected override void RemoveItem(int index)
{
throw new NotImplementedException();
}

/// <summary>
/// Modifies the value of the child object at the specified location.
/// </summary>
/// <param name="index">The index of the child object being modified.</param>
/// <param name="item">The new value for the child object.</param>
protected override void SetItem(int index, TChild item)
{
throw new NotImplementedException();
}

/// <summary>
/// Modifies the value of the parent object of the specified child object.
/// </summary>
/// <param name="child">The child of the parent being modified.</param>
/// <param name="parent">The new value for the parent object.</param>
protected abstract void SetParent(TChild child, TParent parent);
}
}
30 changes: 30 additions & 0 deletions MonoGame.Framework.Content.Pipeline/ContentIdentity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,60 @@ purpose and non-infringement.

namespace Microsoft.Xna.Framework.Content.Pipeline
{
/// <summary>
/// Provides properties describing the origin of the game asset, such as the original source file and creation tool. This information is used for error reporting, and by processors that need to determine from what directory the asset was originally loaded.
/// </summary>
[Serializable]
public class ContentIdentity
{
/// <summary>
/// Gets or sets the specific location of the content item within the larger source file.
/// </summary>
public string FragmentIdentifier { get; set; }

/// <summary>
/// Gets or sets the file name of the asset source.
/// </summary>
public string SourceFilename { get; set; }

/// <summary>
/// Gets or sets the creation tool of the asset.
/// </summary>
public string SourceTool { get; set; }

/// <summary>
/// Initializes a new instance of ContentIdentity.
/// </summary>
public ContentIdentity()
: this(string.Empty, string.Empty, string.Empty)
{
}

/// <summary>
/// Initializes a new instance of ContentIdentity with the specified values.
/// </summary>
/// <param name="sourceFilename">The absolute path to the file name of the asset source.</param>
public ContentIdentity(string sourceFilename)
: this(sourceFilename, string.Empty, string.Empty)
{
}

/// <summary>
/// Initializes a new instance of ContentIdentity with the specified values.
/// </summary>
/// <param name="sourceFilename">The absolute path to the file name of the asset source.</param>
/// <param name="sourceTool">The name of the digital content creation (DCC) tool that created the asset.</param>
public ContentIdentity(string sourceFilename, string sourceTool)
: this(sourceFilename, sourceTool, string.Empty)
{
}

/// <summary>
/// Initializes a new instance of ContentIdentity with the specified values.
/// </summary>
/// <param name="sourceFilename">The absolute path to the file name of the asset source.</param>
/// <param name="sourceTool">The name of the digital content creation (DCC) tool that created the asset.</param>
/// <param name="fragmentIdentifier">Specific location of the content item within the larger source file. For example, this could be a line number in the file.</param>
public ContentIdentity(string sourceFilename, string sourceTool, string fragmentIdentifier)
{
SourceFilename = sourceFilename;
Expand Down
71 changes: 71 additions & 0 deletions MonoGame.Framework.Content.Pipeline/ContentImporter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#region License
/*
Microsoft Public License (Ms-PL)
MonoGame - Copyright © 2012 The MonoGame Team
All rights reserved.
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not
accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under
U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software,
your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including
a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object
code form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees
or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent
permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular
purpose and non-infringement.
*/
#endregion License


namespace Microsoft.Xna.Framework.Content.Pipeline
{
/// <summary>
/// Implements a file format importer for use with game assets.
///
/// Importers, either provided by the framework or written by a developer, must derive from ContentImporter, as well as being marked with a ContentImporterAttribute.
///
/// An importer should produce results in the standard intermediate object model. If an asset has information not supported by the object model, the importer should output it as opaque data (key/value attributes attached to the relevant object). By following this procedure, a content pipeline can access specialized digital content creation (DCC) tool information, even when that information has not been fully standardized into the official object model.
///
/// You can also design custom importers that accept and import types containing specific third-party extensions to the object model.
/// </summary>
public abstract class ContentImporter<T> : IContentImporter
{
/// <summary>
/// Initializes a new instance of ContentImporter.
/// </summary>
protected ContentImporter()
{

}

/// <summary>
/// Called by the framework when importing a game asset. This is the method called by XNA when an asset is to be imported into an object that can be recognized by the Content Pipeline.
/// </summary>
/// <param name="filename">Name of a game asset file.</param>
/// <param name="context">Contains information for importing a game asset, such as a logger interface.</param>
/// <returns>Resulting game asset.</returns>
public abstract T Import(string filename, ContentImporterContext context);
}
}
78 changes: 78 additions & 0 deletions MonoGame.Framework.Content.Pipeline/ContentImporterContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#region License
/*
Microsoft Public License (Ms-PL)
MonoGame - Copyright © 2012 The MonoGame Team
All rights reserved.
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not
accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under
U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software,
your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including
a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object
code form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees
or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent
permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular
purpose and non-infringement.
*/
#endregion License


namespace Microsoft.Xna.Framework.Content.Pipeline
{
/// <summary>
/// Provides properties that define logging behavior for the importer.
/// </summary>
public abstract class ContentImporterContext
{
/// <summary>
/// The absolute path to the root of the build intermediate (object) directory.
/// </summary>
public abstract string IntermediateDirectory { get; }

/// <summary>
/// Gets the logger for an importer.
/// </summary>
public abstract ContentBuildLogger Logger { get; }

/// <summary>
/// The absolute path to the root of the build output (binaries) directory.
/// </summary>
public abstract string OutputDirectory { get; }

/// <summary>
/// Initializes a new instance of ContentImporterContext.
/// </summary>
public ContentImporterContext()
{

}

/// <summary>
/// Adds a dependency to the specified file. This causes a rebuild of the file, when modified, on subsequent incremental builds.
/// </summary>
/// <param name="filename">Name of an asset file.</param>
public abstract void AddDependency(string filename);
}
}
15 changes: 15 additions & 0 deletions MonoGame.Framework.Content.Pipeline/ContentItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,31 @@ purpose and non-infringement.

namespace Microsoft.Xna.Framework.Content.Pipeline
{
/// <summary>
/// Provides properties that define various aspects of content stored using the intermediate file format of the XNA Framework.
/// </summary>
public class ContentItem
{
OpaqueDataDictionary opaqueData = new OpaqueDataDictionary();

/// <summary>
/// Gets or sets the identity of the content item.
/// </summary>
public ContentIdentity Identity { get; set; }

/// <summary>
/// Gets or sets the name of the content item.
/// </summary>
public string Name { get; set; }

/// <summary>
/// Gets the opaque data of the content item.
/// </summary>
public OpaqueDataDictionary OpaqueData { get { return opaqueData; } }

/// <summary>
/// Initializes a new instance of ContentItem.
/// </summary>
public ContentItem()
{
}
Expand Down
Loading

0 comments on commit fb817b1

Please sign in to comment.