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