AStarCollisionMap.QuadTree.CollisionTexture.UpdateCollision C# (CSharp) Méthode

UpdateCollision() public méthode

Updates the collision of this texture, and update the texture as well.
public UpdateCollision ( Rectangle rect, System.Boolean add ) : void
rect Microsoft.Xna.Framework.Rectangle The rectangle that is to be updated.
add System.Boolean Whether to add or remove the rectangle.
Résultat void
        public void UpdateCollision(Rectangle rect, Boolean add)
        {
            // Update collisionmap data
            for (int i = rect.Left; i < rect.Right; i++)
            {
                for (int j = rect.Top; j < rect.Bottom; j++)
                {
                    this.textureData[PointToIndex(i, j)] = add;
                }
            }

            UpdateTexture();
        }