mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Implement plugin system (#1020)
* Implement basic plugin system * The dawn of new era * Add plugins warning * Move more members to PublicAPI * Open commands for the plugins * Add IBotHackNewChat * Run plugin events in parallel * Use properties in IPlugin * Hook our custom plugin into CI to ensure it compiles * Fix dotnet brain damage * Add IBotsComparer * Add code documentation * Add IBotTradeOffer * Add IBotTradeOffer example * Add IBotTradeOfferResults * Final bulletproofing * Final renaming
This commit is contained in:
committed by
GitHub
parent
62a770479e
commit
0f2a816b92
@@ -23,9 +23,10 @@ using System.Collections;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace ArchiSteamFarm.Collections {
|
||||
internal sealed class ConcurrentHashSet<T> : IReadOnlyCollection<T>, ISet<T> {
|
||||
public sealed class ConcurrentHashSet<T> : IReadOnlyCollection<T>, ISet<T> {
|
||||
public int Count => BackingCollection.Count;
|
||||
public bool IsReadOnly => false;
|
||||
|
||||
@@ -114,12 +115,15 @@ namespace ArchiSteamFarm.Collections {
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
// We use Count() and not Any() because we must ensure full loop pass
|
||||
internal bool AddRange(IEnumerable<T> items) => items.Count(Add) > 0;
|
||||
[PublicAPI]
|
||||
public bool AddRange(IEnumerable<T> items) => items.Count(Add) > 0;
|
||||
|
||||
// We use Count() and not Any() because we must ensure full loop pass
|
||||
internal bool RemoveRange(IEnumerable<T> items) => items.Count(Remove) > 0;
|
||||
[PublicAPI]
|
||||
public bool RemoveRange(IEnumerable<T> items) => items.Count(Remove) > 0;
|
||||
|
||||
internal bool ReplaceIfNeededWith(IReadOnlyCollection<T> other) {
|
||||
[PublicAPI]
|
||||
public bool ReplaceIfNeededWith(IReadOnlyCollection<T> other) {
|
||||
if (SetEquals(other)) {
|
||||
return false;
|
||||
}
|
||||
@@ -129,7 +133,8 @@ namespace ArchiSteamFarm.Collections {
|
||||
return true;
|
||||
}
|
||||
|
||||
internal void ReplaceWith(IEnumerable<T> other) {
|
||||
[PublicAPI]
|
||||
public void ReplaceWith(IEnumerable<T> other) {
|
||||
BackingCollection.Clear();
|
||||
|
||||
foreach (T item in other) {
|
||||
|
||||
Reference in New Issue
Block a user