Alexandria.Engines.Sciagi.ResourceMap.DetectVersionSci0 C# (CSharp) Метод

DetectVersionSci0() статический приватный Метод

static private DetectVersionSci0 ( AssetLoader loader ) : bool
loader Glare.Assets.AssetLoader
Результат bool
        static bool DetectVersionSci0(AssetLoader loader)
        {
            var version = ResourceMapVersion.Sci0;
            var reader = loader.Reader;
            var length = loader.Length;

            // File is a simple list of 6-byte resource ids.
            if (length % 6 != 0 || length / 6 > short.MaxValue)
                return false;
            int count = (int)(length / 6);
            for (int index = 0; index < count - 1; index++) {
                ResourceId id = new ResourceId(reader, version);
                if (id.IsEnd)
                    return false;
            }

            ResourceId end = new ResourceId(reader, version);
            if (!end.IsEnd)
                return false;
            return true;
        }