コード例 #1
0
        private IResourceConnection OBJD_setFallback()
        {
            Diagnostics.Log("OBJD_setFallback");
            if ((base.originalKey.ResourceGroup >> 27) > 0)
            {
                return(null);                                           // Only base game objects
            }
            int          fallbackIndex = (int)(uint)base.Resource["FallbackIndex"].Value;
            TGIBlockList tgiBlocks     = base.Resource["TGIBlocks"].Value as TGIBlockList;
            TGIBlock     tgi           = tgiBlocks[fallbackIndex];

            if (tgi.Equals(s3pi.Filetable.RK.NULL))
            {
                fallbackIndex = tgiBlocks.Count;
                base.Resource["FallbackIndex"] = new TypedValue(typeof(uint), (uint)fallbackIndex, "X");
                tgiBlocks.Add(new TGIBlock(0, null, "TGI", base.originalKey.ResourceType, base.originalKey.ResourceGroup, base.originalKey.Instance));
                tgi = tgiBlocks[fallbackIndex];
                Diagnostics.Log("OBJD_setFallback: FallbackIndex: 0x" + fallbackIndex.ToString("X2") + ", Resourcekey: " + tgi);
            }
            return(new DefaultConnection(tgi, tgi, ResourceDataActions.FindWrite, "objd.TGIBlocks[" + fallbackIndex + "]"));
        }
コード例 #2
0
 /// <summary>
 /// Indicates whether the current <see cref="ChunkEntry"/> is equal to another instance.
 /// </summary>
 /// <param name="other">Another instance to compare with this <see cref="ChunkEntry"/>.</param>
 /// <returns><c>true</c> if the current <see cref="ChunkEntry"/> is equal to the <paramref name="other"/> parameter;
 /// otherwise, <c>false</c>.</returns>
 public bool Equals(ChunkEntry other)
 {
     return(tgiBlock.Equals(other.tgiBlock) && rcolBlock.Equals(other.rcolBlock));
 }