예제 #1
0
파일: Chest.cs 프로젝트: nojan1/Mineman
 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 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);
        }
예제 #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);
        }