Пример #1
0
        public ActorEntry CreateActorEntry(ActorTypes type, string name)
        {
            ActorExtraData extraData = new ActorExtraData();

            extraData.BufferType = type;
            extraData.Data       = ActorFactory.CreateExtraData(type);

            ActorEntry entry = ActorFactory.CreateActorItem(type, name);

            entry.DataID = (ushort)(ExtraData.Count);
            entry.Data   = extraData;

            ExtraData.Add(extraData);
            Items.Add(entry);
            return(entry);
        }
Пример #2
0
        public void ReadFromFile(BinaryReader reader)
        {
            buffer = null;
            data   = null;

            bufferType = (ActorTypes)reader.ReadInt32();

            uint bufferLength = reader.ReadUInt32();

            buffer = reader.ReadBytes((int)bufferLength);
            using (MemoryStream stream = new MemoryStream(buffer))
            {
                bool isBigEndian = false; //we'll change this once console parsing is complete.
                data = ActorFactory.LoadExtraData(bufferType, stream, isBigEndian);
                Debug.Assert(bufferLength == stream.Length);
            }

            buffer = (data == null ? buffer : null);
        }