Warning cleanup

This commit is contained in:
2022-04-11 18:03:16 -04:00
parent abcaa85d44
commit 3e226a6a9e
4 changed files with 19 additions and 22 deletions
@@ -50,7 +50,7 @@
var faction = FilterService.GetFactionType();
var immortal = FilterService.GetImmortalType();
var foundEntity = EntityModel.GetFrom(hotkey, hotkeyGroup, isHoldSpace, faction, immortal);
var foundEntity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal);
if (foundEntity != null)
{
+1 -5
View File
@@ -131,11 +131,7 @@ else
protected override async Task OnInitializedAsync()
{
#if NO_SQL
GitService.Load();
#else
GitService.Load(Database);
#endif
await GitService.Load();
}
}
+14 -13
View File
@@ -1,4 +1,5 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -19,7 +20,7 @@ public class EntityModel
private static List<EntityModel> _entityModelsOnlyHotkey = null!;
private static Dictionary<string, List<EntityModel>> _entityModelsByHotkey= null!;
private static Dictionary<string, List<EntityModel>>? _entityModelsByHotkey= null!;
public EntityModel(string data, string entity, bool isSpeculative = false)
@@ -150,9 +151,9 @@ public class EntityModel
select replace).ToList().Count == 0)
select entity;
if (foundList != null && !foundList.Any()) return null;
if (!foundList.Any()) return null;
var found = foundList.First();
var found = (foundList ?? Array.Empty<EntityModel>()).First();
return found;
}
@@ -160,37 +161,37 @@ public class EntityModel
public EntityInfoModel Info()
{
return (EntityInfoModel)EntityParts.Find(x => x.GetType() == typeof(EntityInfoModel));
return ((EntityInfoModel)EntityParts.Find(x => x.GetType() == typeof(EntityInfoModel))!)!;
}
public EntitySupplyModel Supply()
{
return (EntitySupplyModel)EntityParts.Find(x => x.GetType() == typeof(EntitySupplyModel));
return ((EntitySupplyModel)EntityParts.Find(x => x.GetType() == typeof(EntitySupplyModel))!)!;
}
public EntityTierModel Tier()
{
return (EntityTierModel)EntityParts.Find(x => x.GetType() == typeof(EntityTierModel));
return ((EntityTierModel)EntityParts.Find(x => x.GetType() == typeof(EntityTierModel))!)!;
}
public EntityProductionModel Production()
{
return (EntityProductionModel)EntityParts.Find(x => x.GetType() == typeof(EntityProductionModel));
return ((EntityProductionModel)EntityParts.Find(x => x.GetType() == typeof(EntityProductionModel))!)!;
}
public EntityMovementModel Movement()
{
return (EntityMovementModel)EntityParts.Find(x => x.GetType() == typeof(EntityMovementModel));
return ((EntityMovementModel)EntityParts.Find(x => x.GetType() == typeof(EntityMovementModel))!)!;
}
public EntityVitalityModel Vitality()
{
return (EntityVitalityModel)EntityParts.Find(x => x.GetType() == typeof(EntityVitalityModel));
return ((EntityVitalityModel)EntityParts.Find(x => x.GetType() == typeof(EntityVitalityModel))!)!;
}
@@ -217,25 +218,25 @@ public class EntityModel
public EntityVanguardAddedModel VanguardAdded()
{
return (EntityVanguardAddedModel)EntityParts.Find(x => x.GetType() == typeof(EntityVanguardAddedModel));
return ((EntityVanguardAddedModel)EntityParts.Find(x => x.GetType() == typeof(EntityVanguardAddedModel))!)!;
}
public EntityHotkeyModel Hotkey()
{
return (EntityHotkeyModel)EntityParts.Find(x => x.GetType() == typeof(EntityHotkeyModel));
return ((EntityHotkeyModel)EntityParts.Find(x => x.GetType() == typeof(EntityHotkeyModel))!);
}
public EntityFactionModel Faction()
{
return (EntityFactionModel)EntityParts.Find(x => x.GetType() == typeof(EntityFactionModel));
return ((EntityFactionModel)EntityParts.Find(x => x.GetType() == typeof(EntityFactionModel))!);
}
public EntityHarvestModel Harvest()
{
return (EntityHarvestModel)EntityParts.Find(x => x.GetType() == typeof(EntityHarvestModel));
return ((EntityHarvestModel)EntityParts.Find(x => x.GetType() == typeof(EntityHarvestModel))!);
}
+2 -2
View File
@@ -27,8 +27,8 @@ public class NoteService : INoteService {
}
public List<NoteContentModel> NoteContentModels { get; set; } = default!;
public List<NoteConnectionModel> NoteConnectionModels { get; set; }
public List<NoteSectionModel> NoteSectionModels { get; set; }
public List<NoteConnectionModel> NoteConnectionModels { get; set; } = null!;
public List<NoteSectionModel> NoteSectionModels { get; set; } = null!;
public List<NoteContentModel> NoteContentModelsByPageOrder { get; set; } = new();