public static void PostAdd(ImageIdentifier identifier, ImageIdentification selfBase) {
			BackgroundSpecialAnimation self = (BackgroundSpecialAnimation) selfBase;
			if (identifier.TryGetImage(self.AnimationName, out var image)) {
				if (image is Background bg) {
					bg.SpecialAnimations.Add(self);
				}
			}
		}
Exemplo n.º 2
0
        public ImageIdentification IdentifyImage(string[] paths)
        {
            ImageIdentifierType identifier = GetIdentifier(paths[0], out Match match);
            ImageIdentification image      = identifier?.Create() ?? new Unidentified();

            image.Initialize(paths, match);
            AddImage(image);
            identifier?.PostAdd?.Invoke(this, image);
            return(image);
        }
Exemplo n.º 3
0
        public ImageIdentification PreIdentifyImage(string path)
        {
            ImageIdentifierType identifier = GetIdentifier(path, out Match match);
            ImageIdentification image      = identifier?.Create() ?? new Unidentified();

            image.Initialize(path, match, false);
            //AddImage(image);
            //identifier?.PostAdd?.Invoke(this, image);
            return(image);
        }
Exemplo n.º 4
0
 public bool TryGetImage(string name, out ImageIdentification result)
 {
     return(images.TryGetValue(name, out result));
 }
Exemplo n.º 5
0
 public void AddImage(ImageIdentification image)
 {
     images.Add(image.FileName, image);
 }