Esempio n. 1
0
        public Bitmap GetCharacterImage(string characterName, string expression, ImageFormatType imageFormatType)
        {
            string ext           = imageFormatType.ToString();
            var    characterPath = $"{Directory.GetCurrentDirectory()}\\Characters\\{characterName}\\{expression}.{ext}";

            if (!File.Exists(characterPath))
            {
                throw new ArgumentException($"{expression} missing for character {characterName}");
            }
            return(new Bitmap($"{characterPath}"));
        }
Esempio n. 2
0
        public Bitmap GetSceneImage(string sceneName, ImageFormatType imageFormatType)
        {
            string ext           = imageFormatType.ToString();
            var    sceneFilePath = $"{Directory.GetCurrentDirectory()}\\Scenes\\{sceneName}.{ext}";

            if (!File.Exists(sceneFilePath))
            {
                throw new ArgumentException($"{sceneName} is missing");
            }

            return(new Bitmap(sceneFilePath));
        }
Esempio n. 3
0
        public Bitmap GetImageAsset(string fileName, ImageFormatType imageFormatType)
        {
            string ext           = imageFormatType.ToString();
            var    assetFilePath = $"{Directory.GetCurrentDirectory()}\\Assets\\{fileName}.{ext}";

            if (!File.Exists(assetFilePath))
            {
                throw new ArgumentException($"{fileName}.{ext} is not present in the assets folder");
            }

            return(new Bitmap(assetFilePath));
        }