internal NgbhItem(NgbhSlotList parentslot, SimMemoryType type) { this.parentslot = parentslot; this.parent = parentslot.Parent; data = new ushort[0]; flags = new NgbhItemFlags(); objd = null; if (type == SimMemoryType.Aspiration || type == SimMemoryType.Skill || type == SimMemoryType.ValueToken || type == SimMemoryType.Badge) { Flags.IsVisible = false; Flags.IsControler = true; data = new ushort[2]; } else if (type == SimMemoryType.Token) { Flags.IsVisible = false; Flags.IsControler = true; } else if (type == SimMemoryType.Object) { Flags.IsVisible = false; Flags.IsControler = true; data = new ushort[3]; } else if (type == SimMemoryType.Gossip || type == SimMemoryType.Memory) { PutValue(0x01, 0x07CD); PutValue(0x02, 0x0006); PutValue(0x0B, 0); Flags.IsVisible = true; Flags.IsControler = false; if (type == SimMemoryType.Gossip) { this.SimInstance = 1; } } else if (type == SimMemoryType.GossipInventory || type == SimMemoryType.Inventory) { Flags.IsVisible = true; Flags.IsControler = true; if (type == SimMemoryType.GossipInventory) { data = new ushort[8]; PutValue(0x01, 0x0); } this.InventoryNumber = this.ParentSlot.GetNextInventoryNumber(); } //SetGuidForType(type); }
/// <summary> /// Unserializes a BinaryStream into the Attributes of this Instance /// </summary> /// <param name="reader">The Stream that contains the FileData</param> internal void Unserialize(System.IO.BinaryReader reader) { Guid = reader.ReadUInt32(); flags = new NgbhItemFlags(reader.ReadUInt16()); if ((uint)parent.Version >= (uint)NgbhVersion.Business) { flags2 = new NgbhItemFlags(reader.ReadUInt16()); } if ((uint)parent.Version >= (uint)NgbhVersion.Nightlife) { invnr = reader.ReadUInt32(); } else { invnr = 0; } if ((uint)parent.Version >= (uint)NgbhVersion.Seasons) { unknown2 = reader.ReadUInt16(); } else { unknown2 = 0; } data = new ushort[reader.ReadInt32()]; for (int i = 0; i < data.Length; i++) { data[i] = reader.ReadUInt16(); } if (parent != null) { parent.Changed = false; } }