Konstantin Koch 8287c54432 Included the Visual Studio extension and made the necessary changes to make it run.
Replaced the old VS templates with ones that offer more flexiblity.
Started replacing the Content Project for the samples with our custom project type.
Inlcuded a basic not yet working AssimpImporter.
2015-04-08 14:50:03 +02:00

41 lines
1.0 KiB
C#

using ANX.Framework.Content.Pipeline.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ANX.Framework.Content.Pipeline.Helpers
{
internal static class NodeContentHelper
{
public static IEnumerable<T> EnumNodesOfType<T>(NodeContent node) where T : NodeContent
{
if (node == null)
yield break;
if (node.GetType() == typeof(T))
yield return (T)node;
foreach (var child in node.Children)
{
foreach (var childChild in EnumNodesOfType<T>(child))
yield return childChild;
}
}
public static IEnumerable<NodeContent> EnumNodes(NodeContent node)
{
if (node == null)
yield break;
yield return node;
foreach (var child in node.Children)
{
foreach (var childChild in EnumNodes(child))
yield return childChild;
}
}
}
}