Browse Source

Warning cleanup

main
Jonathan McCaffrey 4 years ago
parent
commit
3e226a6a9e
  1. 2
      IGP/Pages/BuildCalculator/Parts/EntityClickViewComponent.razor
  2. 6
      IGP/Pages/ChangeLogPage.razor
  3. 27
      Model/Entity/EntityModel.cs
  4. 6
      Services/Development/NoteService.cs

2
IGP/Pages/BuildCalculator/Parts/EntityClickViewComponent.razor

@ -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)
{

6
IGP/Pages/ChangeLogPage.razor

@ -131,11 +131,7 @@ else
protected override async Task OnInitializedAsync()
{
#if NO_SQL
GitService.Load();
#else
GitService.Load(Database);
#endif
await GitService.Load();
}
}

27
Model/Entity/EntityModel.cs

@ -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))!);
}

6
Services/Development/NoteService.cs

@ -27,9 +27,9 @@ 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();

Loading…
Cancel
Save