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; }
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); }
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); }