当前位置: 首页>>代码示例>>C#>>正文


C# List.Clear方法代码示例

本文整理汇总了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();
        }
开发者ID:K-Cully,项目名称:SticKart,代码行数:24,代码来源:LevelFactory.cs

示例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();
        }
开发者ID:K-Cully,项目名称:SticKart,代码行数:14,代码来源:LevelFactory.cs

示例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();
        }
开发者ID:K-Cully,项目名称:SticKart,代码行数:16,代码来源:LevelFactory.cs


注:本文中的Entities.List.Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。