Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Intersect.Plugins.Interfaces;
- using Intersect.Plugins.Manifests.Types;
- using Intersect.Utilities;
- using Semver;
- using System;
- using System.Collections.Generic;
- namespace Client.Plugins.DiscordButton
- {
- /// <summary>
- /// Defines a plugin manifest in code rather than an embedded manifest.json file.
- /// </summary>
- public struct DiscordButtonManifest : IManifestHelper, IEquatable<IManifestHelper>, IEquatable<DiscordButtonManifest>
- {
- // ReSharper disable once AssignNullToNotNullAttribute This will not be null.
- /// <inheritdoc />
- public string Name => typeof(DiscordButtonManifest).Namespace;
- // ReSharper disable once AssignNullToNotNullAttribute This will not be null.
- /// <inheritdoc />
- public string Key => typeof(DiscordButtonManifest).Namespace;
- /// <inheritdoc />
- public SemVersion Version => new SemVersion(1);
- /// <inheritdoc />
- public Authors Authors =>
- "Author <author@email.com> (some link to your profile or website)";
- /// <inheritdoc />
- public string Homepage => "Homepage link";
- public override bool Equals(object obj) => obj is DiscordButtonManifest other && Equals(other) ||
- obj is IManifestHelper otherManifestHelper &&
- Equals(otherManifestHelper);
- public override int GetHashCode() => ValueUtils.ComputeHashCode(Name, Key, Version, Authors, Homepage);
- public static bool operator ==(DiscordButtonManifest left, DiscordButtonManifest right) => left.Equals(right);
- public static bool operator !=(DiscordButtonManifest left, DiscordButtonManifest right) => !(left == right);
- public bool Equals(DiscordButtonManifest other) => Equals(other as IManifestHelper);
- public bool Equals(IManifestHelper other) => other != null &&
- string.Equals(Name, other.Name, StringComparison.Ordinal) &&
- string.Equals(Key, other.Key, StringComparison.Ordinal) &&
- Version.Equals(other.Version) &&
- Authors.Equals(other.Authors as IEnumerable<Author>) &&
- string.Equals(Homepage, other.Homepage,
- StringComparison.OrdinalIgnoreCase);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement