Removed module projects because it can't work like that atm. Commented out package commands.

This commit is contained in:
Master Kwoth
2017-10-15 09:39:46 +02:00
parent 90e71a3a30
commit 696a0eb2a7
180 changed files with 21625 additions and 1058 deletions

View File

@@ -11,7 +11,6 @@ namespace NadekoBot.Core.Services.Database
IQuoteRepository Quotes { get; }
IGuildConfigRepository GuildConfigs { get; }
IDonatorsRepository Donators { get; }
IClashOfClansRepository ClashOfClans { get; }
IReminderRepository Reminders { get; }
ISelfAssignedRolesRepository SelfAssignedRoles { get; }
IBotConfigRepository BotConfig { get; }

View File

@@ -12,8 +12,6 @@ namespace NadekoBot.Core.Services.Database.Models
public float CurrencyGenerationChance { get; set; } = 0.02f;
public int CurrencyGenerationCooldown { get; set; } = 10;
public HashSet<ModulePrefix> ModulePrefixes { get; set; } = new HashSet<ModulePrefix>();
public List<PlayingStatus> RotatingStatusMessages { get; set; } = new List<PlayingStatus>();
public bool RotatingStatuses { get; set; } = false;
@@ -70,6 +68,7 @@ Nadeko Support Server: https://discord.gg/nadekobot";
public bool CustomReactionsStartWith { get; set; } = false;
public int XpPerMessage { get; set; } = 3;
public int XpMinutesTimeout { get; set; } = 5;
public HashSet<LoadedPackage> LoadedPackages { get; set; } = new HashSet<LoadedPackage>();
}
public class BlockedCmdOrMdl : DbEntity
@@ -155,23 +154,4 @@ Nadeko Support Server: https://discord.gg/nadekobot";
return ((RaceAnimal)obj).Icon == Icon;
}
}
public class ModulePrefix : DbEntity
{
public string ModuleName { get; set; }
public string Prefix { get; set; }
public override int GetHashCode()
{
return ModuleName.GetHashCode();
}
public override bool Equals(object obj)
{
if(!(obj is ModulePrefix))
return base.Equals(obj);
return ((ModulePrefix)obj).ModuleName == ModuleName;
}
}
}

View File

@@ -1,22 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations.Schema;
namespace NadekoBot.Core.Services.Database.Models
{
public class ClashCaller : DbEntity
{
public int? SequenceNumber { get; set; } = null;
public string CallUser { get; set; }
public DateTime TimeAdded { get; set; }
public bool BaseDestroyed { get; set; }
public int Stars { get; set; } = 3;
public int ClashWarId { get; set; }
[ForeignKey(nameof(ClashWarId))]
public ClashWar ClashWar { get; set; }
}
}

View File

@@ -1,32 +0,0 @@
using Discord;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace NadekoBot.Core.Services.Database.Models
{
public class ClashWar : DbEntity
{
public string EnemyClan { get; set; }
public int Size { get; set; }
public StateOfWar WarState { get; set; } = StateOfWar.Created;
public DateTime StartedAt { get; set; }
public ulong GuildId { get; set; }
public ulong ChannelId { get; set; }
[NotMapped]
public ITextChannel Channel { get; set; }
public List<ClashCaller> Bases { get; set; } = new List<ClashCaller>();
}
public enum DestroyStars
{
One, Two, Three
}
public enum StateOfWar
{
Started, Ended, Created
}
}

View File

@@ -7,7 +7,6 @@ using System;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Data.Sqlite;
using System.IO;
using NadekoBot.Core.Services.Database.Models;
namespace NadekoBot.Core.Services.Database
{
@@ -170,16 +169,7 @@ namespace NadekoBot.Core.Services.Database
// .HasForeignKey(mp => mp.BotConfigId);
#endregion
#region ClashOfClans
var callersEntity = modelBuilder.Entity<ClashCaller>();
callersEntity
.HasOne(c => c.ClashWar)
.WithMany(c => c.Bases);
#endregion
#region Self Assignable Roles
var selfassignableRolesEntity = modelBuilder.Entity<SelfAssignedRole>();

View File

@@ -1,10 +0,0 @@
using NadekoBot.Core.Services.Database.Models;
using System.Collections.Generic;
namespace NadekoBot.Core.Services.Database.Repositories
{
public interface IClashOfClansRepository : IRepository<ClashWar>
{
IEnumerable<ClashWar> GetAllWars(List<long> guilds);
}
}

View File

@@ -1,24 +0,0 @@
using NadekoBot.Core.Services.Database.Models;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
namespace NadekoBot.Core.Services.Database.Repositories.Impl
{
public class ClashOfClansRepository : Repository<ClashWar>, IClashOfClansRepository
{
public ClashOfClansRepository(DbContext context) : base(context)
{
}
public IEnumerable<ClashWar> GetAllWars(List<long> guilds)
{
var toReturn = _set
.Where(cw => guilds.Contains((long)cw.GuildId))
.Include(cw => cw.Bases)
.ToList();
toReturn.ForEach(cw => cw.Bases = cw.Bases.Where(w => w.SequenceNumber != null).OrderBy(w => w.SequenceNumber).ToList());
return toReturn;
}
}
}

View File

@@ -18,9 +18,6 @@ namespace NadekoBot.Core.Services.Database
private IDonatorsRepository _donators;
public IDonatorsRepository Donators => _donators ?? (_donators = new DonatorsRepository(_context));
private IClashOfClansRepository _clashOfClans;
public IClashOfClansRepository ClashOfClans => _clashOfClans ?? (_clashOfClans = new ClashOfClansRepository(_context));
private IReminderRepository _reminders;
public IReminderRepository Reminders => _reminders ?? (_reminders = new ReminderRepository(_context));