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);
				}
			}
		}
예제 #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);
        }
예제 #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);
        }
예제 #4
0
 public bool TryGetImage(string name, out ImageIdentification result)
 {
     return(images.TryGetValue(name, out result));
 }
예제 #5
0
 public void AddImage(ImageIdentification image)
 {
     images.Add(image.FileName, image);
 }