Material Equals Method (Object)Delta Engine Documentation

Namespace: DeltaEngine.Content
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public override bool Equals(
	Object obj
)

Return Value

Type: Boolean
Remarks

Tests: DeltaEngine.Tests.Content.MaterialTests
Examples

1 unit tests call DeltaEngine.Content.Material.Equals(System.Object)
[Test]
public void CompareMaterials()
{
    var material2 = new Material(material.Shader, material.DiffuseMap);
    var shader3 =
        ContentLoader.Create<FakeShader>(new ShaderCreationData(ShaderFlags.Colored));
    var image3 = ContentLoader.Create<FakeImage>(new ImageCreationData(new Size(10)));
    var material3 = new Material(shader3, image3);
    Assert.AreEqual(material, material2);
    Assert.AreNotEqual(material2, material3);
    Assert.IsTrue(material2.Equals(material));
    Assert.IsFalse(material2.Equals(material3));
    Assert.AreEqual(material.GetHashCode(), material2.GetHashCode());
    Assert.IsTrue(material.Equals((object)material2));
}
See Also