CCT.NUI.Core.Volume.Contains C# (CSharp) Méthode

Contains() public méthode

public Contains ( int x, int y, int z ) : bool
x int
y int
z int
Résultat bool
        public bool Contains(int x, int y, int z)
        {
            return x >= this.location.X && x <= this.location.X + this.width && y >= this.location.Y && y <= this.location.Y + this.height && z >= this.location.Z && z <= this.location.Z + this.depth;
        }
    }

Usage Example

 public void Test_Volume_Contains()
 {
     var volume = new Volume { X = 0, Y = 0, Z = 0, Width = 10, Height = 10, Depth = 10 };
     Assert.IsTrue(volume.Contains(5, 5, 5));
     Assert.IsFalse(volume.Contains(11, 11, 11));
 }