本文整理汇总了C#中Entities.List.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# List.Clear方法的具体用法?C# List.Clear怎么用?C# List.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities.List
的用法示例。
在下文中一共展示了List.Clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisposeOfInteractiveEntities
/// <summary>
/// Disposes of the interactive entities and clears the list.
/// </summary>
/// <param name="physicsWorld">The physics world containing the entities' bodies.</param>
/// <param name="interactiveEntities">the list of interactive entities.</param>
/// <param name="mineCart">The mine cart.</param>
/// <param name="cartSwitch">The switch entity.</param>
public static void DisposeOfInteractiveEntities(ref World physicsWorld, ref List<InteractiveEntity> interactiveEntities, ref MineCart mineCart, ref Switch cartSwitch)
{
if (mineCart != null)
{
mineCart.Dispose(ref physicsWorld);
mineCart = null;
cartSwitch.Dispose(ref physicsWorld);
cartSwitch = null;
}
foreach (InteractiveEntity entity in interactiveEntities)
{
entity.Dispose(ref physicsWorld);
}
interactiveEntities.Clear();
}
示例2: DisposeOfPlatforms
/// <summary>
/// Disposes of the platforms and clears the list.
/// </summary>
/// <param name="physicsWorld">The physics world containing the platforms' bodies.</param>
/// <param name="platforms">The list of platforms.</param>
public static void DisposeOfPlatforms(ref World physicsWorld, ref List<Platform> platforms)
{
foreach (Platform platform in platforms)
{
platform.Dispose(ref physicsWorld);
}
platforms.Clear();
}
示例3: DisposeOfFloor
/// <summary>
/// Removes the floor bodies from the world and clears the list.
/// </summary>
/// <param name="physicsWorld">The physics world containing the floor.</param>
/// <param name="floorEdges">The list of floor edge bodies.</param>
/// <param name="visualFloorEdges">The list of visual floor edges.</param>
public static void DisposeOfFloor(ref World physicsWorld, ref List<Body> floorEdges, ref List<VisualEdge> visualFloorEdges)
{
visualFloorEdges.Clear();
foreach (Body body in floorEdges)
{
physicsWorld.RemoveBody(body);
}
floorEdges.Clear();
}