private void ReadObjectCreateUpdate(StreamHandler Reader) { var guid = Reader.ReadPackedGuid(); var type = (ObjectTypeId)Reader.ReadByte(); WowObject obj; switch (type) { case ObjectTypeId.Container: obj = new WowContainer(); break; case ObjectTypeId.Corpse: obj = new WowCorpse(); break; case ObjectTypeId.DynamicObject: obj = new WowDynamicObject(); break; case ObjectTypeId.GameObject: obj = new WowGameObject(); break; case ObjectTypeId.Item: obj = new WowItem(); break; case ObjectTypeId.Object: default: throw new Exception("Cannot instantiate an object with TypeId=" + type); case ObjectTypeId.Player: obj = new WowPlayer(); break; case ObjectTypeId.Unit: obj = new WowUnit(); break; case ObjectTypeId.AreaTrigger: obj = new WowAreaTrigger(); break; } obj.Guid = guid; obj.MovementData = new MovementInfo(Reader); obj.SetValues(ReadValues(Reader)); obj.ResetUpdatedFields(); if (!m_createdObjects.ContainsKey(guid)) { m_createdObjects.Add(guid, obj); } else { Console.WriteLine("Error: Created object duplicate guid {0}", guid); } }
public WowDynamicObjectBlip(WowDynamicObject wowGameObject) : base(wowGameObject) { BlipObject = wowGameObject; }