Fix IDE0028, IDE0300, IDE0301, IDE0302, IDE0303, IDE0304.

Silence IDE0305.
This commit is contained in:
RoosterDragon
2025-03-03 17:29:45 +00:00
committed by Pavel Penev
parent 0740991c12
commit 79454d8fd2
559 changed files with 1661 additions and 1751 deletions

View File

@@ -13,7 +13,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Primitives;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
@@ -90,20 +89,20 @@ namespace OpenRA.Mods.Common.Traits
if (unitGroup.BaseActor != null)
{
var facing = unitGroup.BaseActorFacing ?? new WAngle(w.SharedRandom.Next(1024));
var baseActor = w.CreateActor(unitGroup.BaseActor.ToLowerInvariant(), new TypeDictionary
{
var baseActor = w.CreateActor(unitGroup.BaseActor.ToLowerInvariant(),
[
new LocationInit(p.HomeLocation + unitGroup.BaseActorOffset),
new OwnerInit(p),
new SkipMakeAnimsInit(),
new FacingInit(facing),
new SpawnedByMapInit(),
});
]);
var baseActorIsMovable =
baseActor.OccupiesSpace is Mobile mobile && !mobile.IsTraitDisabled && !mobile.IsTraitPaused && !mobile.IsImmovable;
if (baseActorIsMovable)
{
// If the base is movable, we want support actors to be able to path to its location.
homeLocations = new[] { baseActor.Location };
homeLocations = [baseActor.Location];
}
else
{
@@ -116,7 +115,7 @@ namespace OpenRA.Mods.Common.Traits
else
{
// If there is no base actor, we want support actors to be able to path to the home location.
homeLocations = new[] { p.HomeLocation };
homeLocations = [p.HomeLocation];
}
if (unitGroup.SupportActors.Length == 0)
@@ -155,14 +154,14 @@ namespace OpenRA.Mods.Common.Traits
var subCell = ip.SharesCell ? w.ActorMap.FreeSubCell(validCell) : 0;
var facing = unitGroup.SupportActorsFacing ?? new WAngle(w.SharedRandom.Next(1024));
w.CreateActor(s.ToLowerInvariant(), new TypeDictionary
{
w.CreateActor(s.ToLowerInvariant(),
[
new OwnerInit(p),
new LocationInit(validCell),
new SubCellInit(subCell),
new FacingInit(facing),
new SpawnedByMapInit(),
});
]);
}
}
}