/* * Copyright (c) 2014-2017, Eren Okka * Copyright (c) 2016-2017, Paul Miller * Copyright (c) 2017-2018, Tyler Bratton * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ namespace AnitomySharp { /// /// An represents an identified Anime . /// A single filename may contain multiple of the same /// token(e.g ). /// /// 一个元素即是一个已标识的标记(token) /// /// 单个文件名可能包含多个相同的标记,比如:`ElementEpisodeNumber`元素类别的标记 /// public class Element { /// /// Element Categories /// /// 元素类别 /// public enum ElementCategory { /// /// 元素类别:动画季度,不带前缀 /// ElementAnimeSeason, /// /// 元素类别:季度前缀,用于标识季度的元素类别 /// ElementAnimeSeasonPrefix, /// /// 元素类别:动画名 /// ElementAnimeTitle, /// /// 元素类别:动画类型 /// ElementAnimeType, /// /// 元素类别:动画年份,唯一 /// ElementAnimeYear, /// /// 元素类别:音频术语 /// ElementAudioTerm, /// /// 元素类别:设备,用于标识设备类型 /// ElementDeviceCompatibility, /// /// 元素类别:剧集数 /// ElementEpisodeNumber, /// /// 元素类别:等效剧集数,常见于多季度番剧 /// ElementEpisodeNumberAlt, /// /// 元素类别:剧集前缀,比如:“E” /// ElementEpisodePrefix, /// /// 元素类别:剧集名 /// ElementEpisodeTitle, /// /// 元素类别:文件校验码,唯一 /// ElementFileChecksum, /// /// 元素类别:文件扩展名,唯一 /// ElementFileExtension, /// /// 文件名,唯一 /// ElementFileName, /// /// 元素类别:语言 /// ElementLanguage, /// /// 元素类别:其他,暂时无法分类的元素 /// ElementOther, /// /// 元素类别:发布组,唯一 /// ElementReleaseGroup, /// /// 元素类别:发布信息 /// ElementReleaseInformation, /// /// 元素类别:发布版本 /// ElementReleaseVersion, /// /// 元素类别:来源 /// ElementSource, /// /// 元素类别:字幕 /// ElementSubtitles, /// /// 元素类别:视频分辨率 /// ElementVideoResolution, /// /// 元素类别:视频术语 /// ElementVideoTerm, /// /// 元素类别:卷数 /// ElementVolumeNumber, /// /// 元素类别:卷前缀 /// ElementVolumePrefix, /// /// 元素类别:未知元素类型 /// ElementUnknown } /// /// /// public ElementCategory Category { get; set; } /// /// /// public string Value { get; } /// /// Constructs a new Element /// /// 构造一个元素 /// /// the category of the element /// the element's value public Element(ElementCategory category, string value) { Category = category; Value = value; } /// /// /// /// public override int GetHashCode() { return -1926371015 + Value.GetHashCode(); } /// /// /// /// /// public override bool Equals(object obj) { if (this == obj) { return true; } if (obj == null || GetType() != obj.GetType()) { return false; } var other = (Element)obj; return Category.Equals(other.Category); } /// /// /// /// public override string ToString() { return $"Element{{category={Category}, value='{Value}'}}"; } } }