示例#1
0
        private void LoadFiles()
        {
            mappings = FileLoader.LoadMapings();
            nameToId = new Dictionary <string, string>();
            mappings.ForEach(mapping => nameToId[mapping[1]] = mapping[0]);

            var images = FileLoader.LoadImages(mappings);

            foreach (KeyValuePair <string, Bitmap> entry in images)
            {
                this.images[entry.Key] = BitmapConverter.BitmapToImageSource(entry.Value);
                grayImages[entry.Key]  = BitmapConverter.BitmapImageToGraycale(this.images[entry.Key]);
            }

            var avatarMappings = new List <List <string> >()
            {
                new List <string> {
                    "ally_avatar"
                },
                new List <string> {
                    "enemy_avatar"
                },
                new List <string> {
                    "player_avatar"
                }
            };
            var avatarImages = FileLoader.LoadImages(avatarMappings);

            foreach (KeyValuePair <string, Bitmap> entry in avatarImages)
            {
                this.avatarImages[entry.Key] = BitmapConverter.BitmapToImageSource(entry.Value);
            }


            Heroes = FileLoader.LoadHeroes(mappings);


            items = FileLoader.LoadItems();
        }