コード例 #1
0
		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);
 }