Skip to content

Commit

Permalink
Downgrade to .NET 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Pythonic-Rainbow committed Jan 6, 2024
1 parent 2b41080 commit 766f105
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compile-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 6.0.x
- name: Build
run: dotnet publish -c Release -r linux-arm64 --no-self-contained
- name: Upload program
Expand Down
2 changes: 1 addition & 1 deletion Bot/Bot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Hyperstellar</RootNamespace>
Expand Down
32 changes: 23 additions & 9 deletions Bot/Coc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,43 @@ namespace Hyperstellar;
internal class Coc
{

internal readonly struct DonationTuple(int donated, int received)
internal readonly struct DonationTuple
{
internal readonly int Donated = donated;
internal readonly int Received = received;
internal readonly int Donated;
internal readonly int Received;

public DonationTuple(int donated, int received)
{
Donated = donated;
Received = received;
}
}

internal readonly struct ClanMemberInfo(string name, DonationTuple donation)
internal readonly struct ClanMemberInfo
{
internal readonly string Name = name;
internal readonly DonationTuple Donation = donation;
internal readonly string Name;
internal readonly DonationTuple Donation;

public ClanMemberInfo(string name, DonationTuple donation)
{
Name = name;
Donation = donation;
}

internal readonly int Donated => Donation.Donated;
internal readonly int Received => Donation.Received;
}

private readonly struct ClanInfo
{
internal readonly Dictionary<string, ClanMemberInfo> Members = [];
internal readonly Dictionary<string, ClanMemberInfo> Members = new();

public ClanInfo(Clan clan)
{
foreach (var member in clan.MemberList!)
{
Members[member.Tag] = new(member.Name, new(member.Donations, member.DonationsReceived));
DonationTuple donation = new(member.Donations, member.DonationsReceived);
Members[member.Tag] = new(member.Name, donation);
}
}
}
Expand All @@ -50,7 +64,7 @@ private static async Task PollAsync()

private static async Task CheckDonations(ClanInfo clan, Clan c)
{
Dictionary<string, DonationTuple> donationsDelta = [];
Dictionary<string, DonationTuple> donationsDelta = new();
foreach (var memberTag in clan.Members.Keys)
{
bool existsInPrevClan = _prevClan.Members.TryGetValue(memberTag, out ClanMemberInfo previous);
Expand Down

0 comments on commit 766f105

Please sign in to comment.