BlocksContent Prefix Property Delta Engine Documentation

Namespace: Blocks
Assembly: Blocks (in Blocks.exe) Version: 1.1.1.0 (1.1.1)
Syntax

public string Prefix { get; set; }

Property Value

Type: String
Remarks

Tests: Blocks.Tests.BlocksContentTests
Remarks

Tests: Blocks.Tests.FruitBlocksContentTests
Remarks

Tests: Blocks.Tests.JewelBlocksContentTests
Examples

4 unit tests call Blocks.BlocksContent.Prefix
[Test, CloseAfterFirstFrame]
public void GetFilenameWithoutPrefix()
{
    var content = new JewelBlocksContent { Prefix = "ABC" };
    Assert.AreEqual("DEF", content.GetFilenameWithoutPrefix("ABCDEF"));
    Assert.Throws<BlocksContent.FilenameWrongPrefixException>(
        () => content.GetFilenameWithoutPrefix("ADEF"));
    Assert.Throws<BlocksContent.FilenameWrongPrefixException>(
        () => content.GetFilenameWithoutPrefix("AAADEF"));
}
[Test, CloseAfterFirstFrame]
public void LoadContentWithNoPrefixSet()
{
    var material = new Material(ShaderFlags.Position2DColoredTextured, "FruitBlocks_Block1");
    Assert.IsNotNull(material.DiffuseMap);
}
[Test, CloseAfterFirstFrame]
public void LoadContentWithPrefixSet()
{
    var content = new JewelBlocksContent { Prefix = "Mod1_" };
    var material = new Material(ShaderFlags.Position2DColoredTextured, "DeltaEngineLogo");
    new Sprite(material, new Rectangle(0.3f, 0.45f, 0.1f, 0.1f));
    content.Prefix = "Mod2_";
    material = new Material(ShaderFlags.Position2DColoredTextured, "DeltaEngineLogo");
    new Sprite(material, new Rectangle(0.6f, 0.45f, 0.1f, 0.1f));
}
Examples

1 unit tests call Blocks.BlocksContent.Prefix
[Test, CloseAfterFirstFrame]
public void Constructor()
{
    var content = new FruitBlocksContent();
    Assert.AreEqual("FruitBlocks_", content.Prefix);
    Assert.IsTrue(content.AreFiveBrickBlocksAllowed);
    Assert.IsTrue(content.DoBricksSplitInHalfWhenRowFull);
}
Examples

1 unit tests call Blocks.BlocksContent.Prefix
[Test, CloseAfterFirstFrame]
public void Constructor()
{
    var content = new JewelBlocksContent();
    Assert.AreEqual("JewelBlocks_", content.Prefix);
    Assert.IsTrue(content.AreFiveBrickBlocksAllowed);
    Assert.IsFalse(content.DoBricksSplitInHalfWhenRowFull);
}
See Also