Skip to content

Commit

Permalink
Xbox demo seems to be stable?
Browse files Browse the repository at this point in the history
  • Loading branch information
dubajj committed Dec 5, 2010
1 parent b7d5267 commit f79ed9b
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 12 deletions.
1 change: 1 addition & 0 deletions ContentTracker/ContentTracker.Xbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<Compile Include="AssetTracker.cs" />
<Compile Include="ContentTracker.cs" />
<Compile Include="ContentTrackerAsync.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions ContentTracker/ContentTracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<Compile Include="AssetTracker.cs" />
<Compile Include="ContentTracker.cs" />
<Compile Include="ContentTrackerAsync.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SourceAssetLoader.cs" />
</ItemGroup>
Expand Down
56 changes: 56 additions & 0 deletions ContentTracker/Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Arands.Content
{
public static class Extensions
{
/// <summary>
/// Removes all elements from the List that match the conditions defined by the specified predicate.
/// </summary>
/// <typeparam name="T">The type of elements held by the List.</typeparam>
/// <param name="list">The List to remove the elements from.</param>
/// <param name="match">The Predicate delegate that defines the conditions of the elements to remove.</param>
public static int RemoveAll<T>(this System.Collections.Generic.List<T> list, Func<T, bool> match)
{
int numberRemoved = 0;

// Loop through every element in the List, in reverse order since we are removing items.
for (int i = (list.Count - 1); i >= 0; i--)
{
// If the predicate function returns true for this item, remove it from the List.
if (match(list[i]))
{
list.RemoveAt(i);
numberRemoved++;
}
}

// Return how many items were removed from the List.
return numberRemoved;
}

/// <summary>
/// Returns true if the List contains elements that match the conditions defined by the specified predicate.
/// </summary>
/// <typeparam name="T">The type of elements held by the List.</typeparam>
/// <param name="list">The List to search for a match in.</param>
/// <param name="match">The Predicate delegate that defines the conditions of the elements to match against.</param>
public static bool Exists<T>(this System.Collections.Generic.List<T> list, Func<T, bool> match)
{
// Loop through every element in the List, until a match is found.
for (int i = 0; i < list.Count; i++)
{
// If the predicate function returns true for this item, return that at least one match was found.
if (match(list[i]))
return true;
}

// Return that no matching elements were found in the List.
return false;
}
}
}

12 changes: 9 additions & 3 deletions ContentTrackerTestGame/ContentTrackerTestGame.Xbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
<Reference Include="Microsoft.Xna.Framework.Game">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Xna.Framework.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Xna.Framework.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
<Reference Include="mscorlib">
<Private>False</Private>
</Reference>
Expand All @@ -148,10 +151,13 @@
<Project>{006E3C64-E3A2-4C4D-BF0F-0ED95B8EC7D0}</Project>
<Name>ContentTracker.Xbox</Name>
</ProjectReference>
<ProjectReference Include="..\Content\Content.contentproj">
<Project>{F3E38D17-27C4-46EF-9CF8-04D2E4376071}</Project>
<Name>Content</Name>
<XnaReferenceType>Content</XnaReferenceType>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Content\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
Content\SpriteFont1.xnb
Content\Pyramid.xnb
Content\TerrainDarkStone2.xnb
Content\Teapot.xnb
Content\Torus.xnb
Content\Cone.xnb
Content\Cylinder.xnb
Content\Pyramid.xnb
Content\SkyDay.xnb
Content\Teapot.xnb
Content\TerrainDarkStone2.xnb
Content\Torus.xnb
Content\SpriteFont1.xnb
Content\jungle.xnb
Content\moss.xnb
Content\Sanddune.xnb
Content\SkyDayTexture.xnb
Content\stone.xnb
Content\TerrainDesertCanyon.xnb
Content\wood_worn.xnb
Content\moss_0.xnb
Content\TerrainDesertCanyon_0.xnb
Content\jungle_0.xnb
Content\stone_0.xnb
Content\SkyDayTexture_0.xnb
Content\Sanddune_0.xnb
Content\stone_0.xnb
Content\wood_worn_0.xnb
Content\moss_0.xnb
Content\TerrainDesertCanyon_0.xnb
Content\SkyDay_0.xnb
Binary file modified XNAContentTracker.suo
Binary file not shown.

0 comments on commit f79ed9b

Please sign in to comment.