示例#1
0
        ///<summary>
        /// Cleans up the pair handler.
        ///</summary>
        public override void CleanUp()
        {
            base.CleanUp();

            staticGroup = null;
            //Child type needs to null out other reference.
        }
示例#2
0
 ///<summary>
 /// Constructs a new StaticGroupShape.
 ///</summary>
 ///<param name="collidables">List of collidables in the StaticGroup.</param>
 ///<param name="owner">StaticGroup directly associated with this shape.</param>
 public StaticGroupShape(IList <Collidable> collidables, StaticGroup owner)
 {
     this.StaticGroup = owner;
     CollidableTree   = new BoundingBoxTree <Collidable>(collidables);
     //Rather than hooking up a bunch of ShapeChanged events here that don't capture the full capacity of change
     //in our child collidables, we will rely on the user telling the collidable tree to reformat itself directly.
 }
示例#3
0
        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {
            //Other member of the pair is initialized by the child.
            staticGroup = entryA as StaticGroup;
            if (staticGroup == null)
            {
                staticGroup = entryB as StaticGroup;
                if (staticGroup == null)
                {
                    throw new ArgumentException("Inappropriate types used to initialize pair.");
                }
            }

            base.Initialize(entryA, entryB);
        }