diff --git a/OpenRA.Mods.Cnc/FileFormats/WsaVideo.cs b/OpenRA.Mods.Cnc/FileFormats/WsaVideo.cs index 495ea94950..d4cae79ec7 100644 --- a/OpenRA.Mods.Cnc/FileFormats/WsaVideo.cs +++ b/OpenRA.Mods.Cnc/FileFormats/WsaVideo.cs @@ -120,7 +120,7 @@ namespace OpenRA.Mods.Cnc.FileFormats var dataLength = frameOffsets[CurrentFrameIndex + 1] - frameOffsets[CurrentFrameIndex]; - var rawData = StreamExts.ReadBytes(stream, (int)dataLength); + var rawData = stream.ReadBytes((int)dataLength); var intermediateData = new byte[Width * Height]; // Format80 decompression diff --git a/OpenRA.Mods.Cnc/VideoLoaders/WsaLoader.cs b/OpenRA.Mods.Cnc/VideoLoaders/WsaLoader.cs index 19c5a4a3d2..6c0637bb8d 100644 --- a/OpenRA.Mods.Cnc/VideoLoaders/WsaLoader.cs +++ b/OpenRA.Mods.Cnc/VideoLoaders/WsaLoader.cs @@ -55,7 +55,7 @@ namespace OpenRA.Mods.Cnc.VideoLoaders if (flags == 1) { - var palette = StreamExts.ReadBytes(s, 768); + var palette = s.ReadBytes(768); for (var i = 0; i < offsets.Length; i++) offsets[i] += 768; } diff --git a/OpenRA.Mods.Common/Activities/Move/Move.cs b/OpenRA.Mods.Common/Activities/Move/Move.cs index f1720b810b..812e77c050 100644 --- a/OpenRA.Mods.Common/Activities/Move/Move.cs +++ b/OpenRA.Mods.Common/Activities/Move/Move.cs @@ -204,7 +204,7 @@ namespace OpenRA.Mods.Common.Activities return null; } - var containsTemporaryBlocker = WorldUtils.ContainsTemporaryBlocker(self.World, nextCell, self); + var containsTemporaryBlocker = self.World.ContainsTemporaryBlocker(nextCell, self); // Next cell in the move is blocked by another actor if (containsTemporaryBlocker || !mobile.CanEnterCell(nextCell, ignoreActor)) diff --git a/OpenRA.Mods.Common/Effects/Beacon.cs b/OpenRA.Mods.Common/Effects/Beacon.cs index 03521d0330..550855f70a 100644 --- a/OpenRA.Mods.Common/Effects/Beacon.cs +++ b/OpenRA.Mods.Common/Effects/Beacon.cs @@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Effects if (clockFraction != null) { clock = new Animation(owner.World, posterCollection); - clock.PlayFetchIndex(clockSequence, () => Exts.Clamp((int)(clockFraction() * (clock.CurrentSequence.Length - 1)), 0, clock.CurrentSequence.Length - 1)); + clock.PlayFetchIndex(clockSequence, () => ((int)(clockFraction() * (clock.CurrentSequence.Length - 1))).Clamp(0, clock.CurrentSequence.Length - 1)); } } } diff --git a/OpenRA.Mods.Common/Orders/GlobalButtonOrderGenerator.cs b/OpenRA.Mods.Common/Orders/GlobalButtonOrderGenerator.cs index d76c573a77..c8ce76e2f2 100644 --- a/OpenRA.Mods.Common/Orders/GlobalButtonOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/GlobalButtonOrderGenerator.cs @@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Orders protected virtual bool IsValidTrait(T t) { - return Exts.IsTraitEnabled(t); + return t.IsTraitEnabled(); } protected IEnumerable OrderInner(World world, MouseInput mi) diff --git a/OpenRA.Mods.Common/Traits/BlocksProjectiles.cs b/OpenRA.Mods.Common/Traits/BlocksProjectiles.cs index 1a76783553..c6a0e6f7b4 100644 --- a/OpenRA.Mods.Common/Traits/BlocksProjectiles.cs +++ b/OpenRA.Mods.Common/Traits/BlocksProjectiles.cs @@ -58,7 +58,7 @@ namespace OpenRA.Mods.Common.Traits if (blockers.Count == 0) continue; - var hitPos = WorldExtensions.MinimumPointLineProjection(start, end, a.CenterPosition); + var hitPos = start.MinimumPointLineProjection(end, a.CenterPosition); var dat = world.Map.DistanceAboveTerrain(hitPos); if ((hitPos - start).Length < length && blockers.Any(t => t.BlockingHeight > dat)) { diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractWeaponDocsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractWeaponDocsCommand.cs index 6364d0f584..2312e94337 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractWeaponDocsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractWeaponDocsCommand.cs @@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.UtilityCommands var warheads = objectCreator.GetTypesImplementing().OrderBy(t => t.Namespace); var projectiles = objectCreator.GetTypesImplementing().OrderBy(t => t.Namespace); - var weaponTypes = Enumerable.Concat(weaponInfo, Enumerable.Concat(projectiles, warheads)); + var weaponTypes = weaponInfo.Concat(projectiles.Concat(warheads)); foreach (var t in weaponTypes) { // skip helpers like TraitInfo diff --git a/OpenRA.Mods.Common/WorldExtensions.cs b/OpenRA.Mods.Common/WorldExtensions.cs index 8f9fee53d0..48e1e45aa8 100644 --- a/OpenRA.Mods.Common/WorldExtensions.cs +++ b/OpenRA.Mods.Common/WorldExtensions.cs @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common if (shapes.Any()) actorWidth = shapes.Max(h => h.Info.Type.OuterRadius.Length); - var projection = MinimumPointLineProjection(lineStart, lineEnd, currActor.CenterPosition); + var projection = lineStart.MinimumPointLineProjection(lineEnd, currActor.CenterPosition); var distance = (currActor.CenterPosition - projection).HorizontalLength; var maxReach = actorWidth + lineWidth.Length; @@ -84,7 +84,7 @@ namespace OpenRA.Mods.Common /// The target point (head) of the line /// The target point that the minimum distance should be found to /// The WPos that is the point on the line that is closest to the target point - public static WPos MinimumPointLineProjection(WPos lineStart, WPos lineEnd, WPos point) + public static WPos MinimumPointLineProjection(this WPos lineStart, WPos lineEnd, WPos point) { var squaredLength = (lineEnd - lineStart).HorizontalLengthSquared;