コード例 #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 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);
        }