Пример #1
0
 public InventoryItem(TagCompound tag)
 {
     Id = tag.GetTag("id").ToValueString();
     Count = tag.GetByteValue("Count");
     Damage = tag.GetShortValue("Damage");
     Slot = tag.GetByteValue("Slot");
     Tag = tag.Contains("tag") ? tag.GetCompound("tag") : null;
 }
Пример #2
0
        public void GetByteValue_returns_default_value()
        {
            // arrange
            TagCompound target;
            byte        expected;
            byte        actual;
            string      name;

            expected = (byte)(byte.MaxValue >> 1);
            name     = "alpha";

            target = new TagCompound();

            // act
            actual = target.GetByteValue(name, expected);

            // assert
            Assert.AreEqual(expected, actual);
        }