Ejemplo n.º 1
0
        static IPattern CreatePattern(string FilePath)
        {
            var assembly     = Assembly.GetExecutingAssembly();
            var resourceName = $"{nameof(FateGrandAutomata)}.{FilePath}";

            var stream = assembly.GetManifestResourceStream(resourceName);

            if (stream == null)
            {
                return(null);
            }

            using (stream)
            {
                return(AutomataApi.LoadPattern(stream));
            }
        }
Ejemplo n.º 2
0
        public static IPattern LoadSupportImagePattern(string FileName)
        {
            if (!SupportCachedPatterns.ContainsKey(FileName))
            {
                var stream = FileLoader(FileName);

                if (stream == null)
                {
                    throw new ScriptExitException(
                              $"Unable to load image: {FileName}. Put images in {SupportImgFolder} folder");
                }

                using (stream)
                {
                    SupportCachedPatterns.Add(FileName, AutomataApi.LoadPattern(stream));
                }
            }

            return(SupportCachedPatterns[FileName]);
        }