Example #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;
 }
Example #2
0
        public void Contains_returns_true_if_found()
        {
            // arrange
            var target = new TagCompound();

            target.Value.Add("Beta", 10);
            target.Value.Add("Alpha", 11);
            target.Value.Add("Gamma", 12);

            // act
            var actual = target.Contains("Alpha");

            // assert
            Assert.True(actual);
        }
Example #3
0
        public void Contains_returns_false_if_not_found()
        {
            // arrange
            TagCompound target;
            bool        actual;

            target = new TagCompound();

            target.Value.Add("Beta", 10);
            target.Value.Add("Alpha", 11);
            target.Value.Add("Gamma", 12);

            // act
            actual = target.Contains("Delta");

            // assert
            Assert.IsFalse(actual);
        }