Fix IDE0039

This commit is contained in:
RoosterDragon
2023-02-19 11:56:54 +00:00
committed by abcdefg30
parent 4b3f7034b2
commit d4135d608e
67 changed files with 498 additions and 505 deletions

View File

@@ -207,7 +207,7 @@ namespace OpenRA.Mods.Common.Traits
public MiniYaml Save()
{
Func<object, bool> saveInit = init =>
bool SaveInit(ActorInit init)
{
if (init is FactionInit factionInit && factionInit.Value == Owner.Faction)
return false;
@@ -218,9 +218,9 @@ namespace OpenRA.Mods.Common.Traits
// TODO: Other default values will need to be filtered
// here after we have built a properties panel
return true;
};
}
return reference.Save(saveInit);
return reference.Save(SaveInit);
}
WPos PreviewPosition(World world, ActorReference actor)

View File

@@ -303,12 +303,12 @@ namespace OpenRA.Mods.Common.Traits
if (check > BlockedByActor.None)
{
Func<Actor, bool> checkTransient = otherActor => IsBlockedBy(self, otherActor, ignoreActor, cell, check, GetCache(cell).CellFlag);
bool CheckTransient(Actor otherActor) => IsBlockedBy(self, otherActor, ignoreActor, cell, check, GetCache(cell).CellFlag);
if (!sharesCell)
return world.ActorMap.AnyActorsAt(cell, SubCell.FullCell, checkTransient) ? SubCell.Invalid : SubCell.FullCell;
return world.ActorMap.AnyActorsAt(cell, SubCell.FullCell, CheckTransient) ? SubCell.Invalid : SubCell.FullCell;
return world.ActorMap.FreeSubCell(cell, preferredSubCell, checkTransient);
return world.ActorMap.FreeSubCell(cell, preferredSubCell, CheckTransient);
}
if (!sharesCell)

View File

@@ -26,14 +26,14 @@ namespace OpenRA.Mods.Common.Traits
{
var missingImages = new HashSet<string>();
var failed = false;
Action<uint, string> onMissingImage = (id, f) =>
void OnMissingImage(uint id, string f)
{
onError($"\tTemplate `{id}` references sprite `{f}` that does not exist.");
missingImages.Add(f);
failed = true;
};
}
var tileCache = new DefaultTileCache((DefaultTerrain)terrainInfo, onMissingImage);
var tileCache = new DefaultTileCache((DefaultTerrain)terrainInfo, OnMissingImage);
foreach (var t in terrainInfo.Templates)
{
var templateInfo = (DefaultTerrainTemplateInfo)t.Value;