コード例 #1
0
        /// <summary>
        /// Lazy initialization of handle fields. They are initialized on the first access.
        /// because the mpq storage may not have finished loading and thus, the referenced sno may not be found
        /// </summary>
        private void Initialize()
        {
            // Look up the group if it is not set. Maybe one big
            // asset dictionary would be more convenient here
            _isInitialized = true;
            if (!_group.HasValue)
            {
                foreach (var pair in MPQStorage.Data.Assets)
                {
                    if (pair.Value.ContainsKey(Id))
                    {
                        _group = pair.Key;
                        break;
                    }
                }
            }

            if (_group.HasValue)
            {
                if (MPQStorage.Data != null && MPQStorage.Data.Assets.ContainsKey(_group.Value))
                {
                    if (MPQStorage.Data.Assets[_group.Value].ContainsKey(Id))
                    {
                        _isValid = true;
                        _target  = MPQStorage.Data.Assets[_group.Value][Id].Data;
                        _name    = MPQStorage.Data.Assets[_group.Value][Id].Name;
                    }
                }
            }
        }
コード例 #2
0
 public SNOHandle(int snoId)
 {
     Id = snoId;
     if (snoId == NO_ID)
     {
         _group = SNOGroup.None;
     }
 }
コード例 #3
0
 /// <summary>
 /// Parses SNOName from given GameBitBuffer.
 /// </summary>
 /// <param name="buffer">The GameBitBuffer to parse from.</param>
 public void Parse(GameBitBuffer buffer)
 {
     _group = (SNOGroup)buffer.ReadInt(32);
     Id     = buffer.ReadInt(32);
 }
コード例 #4
0
 /// <summary>
 /// Reads SNOName from given MPQFileStream.
 /// </summary>
 /// <param name="stream">The MPQFileStream to read from.</param>
 public SNOHandle(MpqFileStream stream)
 {
     _group = (SNOGroup)stream.ReadValueS32();
     Id     = stream.ReadValueS32();
 }
コード例 #5
0
 public SNOHandle(SNOGroup group, int id)
 {
     _group = group;
     Id     = id;
 }
コード例 #6
0
ファイル: SNOHandle.cs プロジェクト: wow4all/mooege
 public SNOHandle(SNOGroup group, int id)
 {
     _group = group;
     Id = id;
 }
コード例 #7
0
ファイル: SNOHandle.cs プロジェクト: wow4all/mooege
 /// <summary>
 /// Parses SNOName from given GameBitBuffer.
 /// </summary>
 /// <param name="buffer">The GameBitBuffer to parse from.</param>
 public void Parse(GameBitBuffer buffer)
 {
     _group = (SNOGroup)buffer.ReadInt(32);
     Id = buffer.ReadInt(32);
 }
コード例 #8
0
ファイル: SNOHandle.cs プロジェクト: wow4all/mooege
 /// <summary>
 /// Reads SNOName from given MPQFileStream.
 /// </summary>
 /// <param name="stream">The MPQFileStream to read from.</param>
 public SNOHandle(MpqFileStream stream)
 {
     _group = (SNOGroup)stream.ReadValueS32();
     Id = stream.ReadValueS32();
 }
コード例 #9
0
ファイル: SNOHandle.cs プロジェクト: wow4all/mooege
        /// <summary>
        /// Lazy initialization of handle fields. They are initialized on the first access.
        /// because the mpq storage may not have finished loading and thus, the referenced sno may not be found
        /// </summary>
        private void Initialize()
        {
            // Look up the group if it is not set. Maybe one big
            // asset dictionary would be more convenient here
            _isInitialized = true;
            if (!_group.HasValue)
            {
                foreach (var pair in MPQStorage.Data.Assets)
                    if (pair.Value.ContainsKey(Id))
                    {
                        _group = pair.Key;
                        break;
                    }
            }

            if (_group.HasValue)
                if (MPQStorage.Data != null && MPQStorage.Data.Assets.ContainsKey(_group.Value))
                    if (MPQStorage.Data.Assets[_group.Value].ContainsKey(Id))
                    {
                        _isValid = true;
                        _target = MPQStorage.Data.Assets[_group.Value][Id].Data;
                        _name = MPQStorage.Data.Assets[_group.Value][Id].Name;
                    }
        }
コード例 #10
0
ファイル: SNOHandle.cs プロジェクト: wow4all/mooege
 public SNOHandle(int snoId)
 {
     Id = snoId;
     if (snoId == NO_ID)
         _group = SNOGroup.None;
 }