Commit Graph

28680 Commits

Author SHA1 Message Date
Mustafa Alperen Seki
91f626c42a Make WithVoxelWalkerBody PausableConditional. 2022-02-18 12:24:23 +01:00
dnqbob
6c33d47ef3 Update rule on renaming 'CloakTypes' to 'DetectionTypes' 2022-02-12 19:30:21 +01:00
dnqbob
831bed2c4d Add enter-cloak & exit-cloak effect for Cloak 2022-02-12 19:30:21 +01:00
RoosterDragon
d67f696bd0 Move BlockedByActor, IPositionableInfo, IPositionable to Mods.Common.
Actor previously cached targetable locations for static actors as an optimization. As we can no longer reference the IPositionable interface, move this optimization to HitShape instead. Although we lose some of the efficiency of caching the final result on the actor, we gain some by allowing HitShape to cache the results as long as they have not changed. So instead of being limited to static actors, we can extend the caching to currently stationary actor.
2022-02-11 23:35:08 +01:00
RoosterDragon
d8a4d7fd1d Cache the global mix database in MixLoader
We can reuse this global database as it doesn't change, rather than loading a new copy each time a new mix file is parsed.
2022-02-11 14:05:55 +01:00
RoosterDragon
f5d1fe4bc4 Use more efficient search in MergeIntoResolved
Switch Enumerable.FirstOrDefault to List.Find. The latter can avoid some allocations because the concrete collection type is known.
2022-02-11 14:01:16 +01:00
RoosterDragon
ed72e61f8f Add detailed documentation for BlockedByActor enum. 2022-02-08 23:34:07 +01:00
RoosterDragon
9cd55df584 Ensure editorconfig naming styles align with StyleCop SA13XX style rules.
Aligns the naming conventions defined in editorconfig (dotnet_naming_style, dotnet_naming_symbols, dotnet_naming_rule) which are reported under the IDE1006 rule with the existing StyleCop rules from the SA13XX range.

This ensures the two rulesets agree when rejecting and accepting naming conventions within the IDE, with a few edges cases where only one ruleset can enforce the convention. IDE1006 allows use to specify a naming convention for type parameters, const locals and protected readonly fields which SA13XX cannot enforce. Some StyleCop SA13XX rules such as SA1309 'Field names should not begin with underscore' are not possible to enforce with the naming rules of IDE1006.

Therefore we enable the IDE1006 as a build time warning to enforce conventions and extend them. We disable SA13XX rules that can now be covered by IDE1006 to avoid double-reporting but leave the remaining SA13XX rules that cover additional cases enabled.

We also re-enable the SA1311 rule convention but enforce it via IDE1006, requiring some violations to be fixed or duplication of existing suppressions. Most violations fixes are trivial renames with the following exception. In ActorInitializer.cs, we prefer to make the fields private instead. ValueActorInit provides a publicly accessible property for access and OwnerInit provides a publicly accessible method. Health.cs is adjusted to access the property base instead when overriding. The reflection calls must be adjusted to target the base class specifically, as searching for a private field from the derived class will fail to locate it on the base class.

Unused suppressions were removed.
2022-02-07 19:14:45 +01:00
Gustas
13ee62c181 Make overlay dropdown optional 2022-02-06 19:21:43 +01:00
Gustas
addfdf50fa Crash when EditorWorld does not have BuildableTerrainOverlay 2022-02-06 19:21:43 +01:00
reaperrr
a17af87a5e Fix aircraft with TakeOffOnCreation=false not freeing exit
...when another actor gets produced.
2022-02-06 19:20:29 +01:00
reaperrr
44fc4a1d0f Fix random placement of AssociateWithAirfieldActivity
It doesn't belong to IMove, so it doesn't belong into that region.
Put it near ICreationActivity where it belongs.
2022-02-06 19:20:29 +01:00
darkademic
257ef95963 Suffix projectile shadow palettes with player name if IsPlayerPalette = true. 2022-02-06 19:18:59 +01:00
Matthias Mailänder
9bb41630e7 Update documentation action to .NET 6 2022-02-06 18:06:44 +01:00
Ivaylo Draganov
f5ab9d95fe Make remove from control group hotkey available only to players 2022-02-06 09:09:33 -06:00
Mustafa Alperen Seki
c096934db8 Fix projectile shadow alpha calculation. 2022-02-04 23:35:44 +01:00
Ivaylo Draganov
1813edc74b Add contexts for hotkey validation 2022-02-04 18:49:05 +01:00
RoosterDragon
1bc95a290f Preallocate dictionary size in ToDictionaryWithConflictLog 2022-02-02 15:10:37 +01:00
Smittytron
74cced319c Change terrain type of clear straight bridge tiles 2022-01-31 14:19:47 +01:00
RoosterDragon
bd30c66f95 Reuse object arrays in FieldLoader Parse methods 2022-01-30 19:47:06 +01:00
RoosterDragon
2ab3917f29 Clean up usage of DomainIndex
- When a path search is being performed the path search will not attempt route to inaccessible cells, so domain index checks to avoid inaccessible cells in the search predicate are redundant and can be removed.
- DomainIndex is a required world trait, so we don't need to use TraitOrDefault and therefore can avoid dealing with the null case.
2022-01-30 16:22:26 +01:00
Matthias Mailänder
4b4b0125a2 Make UnitsInRange accessible to mod code. 2022-01-30 11:56:43 +01:00
Matthias Mailänder
240c96b781 Expose sprite sequence to linting and documentation. 2022-01-30 11:56:43 +01:00
RoosterDragon
6dc189b7d1 Rearrange various API surfaces related to pathfinding.
The existing APIs surfaces for pathfinding are in a wonky shape. We rearrange various responsibilities to better locations and simplify some abstractions that aren't providing value.

- IPathSearch, BasePathSearch and PathSearch are combined into only PathSearch. Its role is now to run a search space over a graph, maintaining the open queue and evaluating the provided heuristic function. The builder-like methods (WithHeuristic, Reverse, FromPoint, etc) are removed in favour of optional parameters in static creation methods. This removes confusion between the builder-aspect and the search function itself. It also becomes responsible for applying the heuristic weight to the heuristic. This fixes an issue where an externally provided heuristic ignored the weighting adjustment, as previously the weight was baked into the default heuristic only.
- Reduce the IGraph interface to the concepts of nodes and edges. Make it non-generic as it is specifically for pathfinding, and rename to IPathGraph accordingly. This is sufficient for a PathSearch to perform a search over any given IGraph. The various customization options are concrete properties of PathGraph only.
- PathFinder does not need to deal with disposal of the search/graph, that is the caller's responsibility.
- Remove CustomBlock from PathGraph as it was unused.
- Remove FindUnitPathToRange as it was unused.
- Use PathFinder.NoPath as the single helper to represent no/empty paths.
2022-01-30 11:47:52 +01:00
Matthias Mailänder
cd1fe2d23b Fix saving into writable system directories. 2022-01-30 11:46:42 +01:00
abcdefg30
2af8296f48 Add the possibility to always show detection circles 2022-01-30 11:41:02 +01:00
abcdefg30
7c085e49c7 Cache DetectCloaked traits in RenderDetectionCircle 2022-01-30 11:41:02 +01:00
xan2622
13fbc412d2 removal 2022-01-30 11:28:16 +01:00
abcdefg30
a9cd2d41c7 Fix ToAhsv using the wrong type for alpha 2022-01-29 13:44:02 +01:00
Ivaylo Draganov
7a93b9ea8c Make control group hotkeys configurable
- Split control groups management to its own interface
- Add hotkeys for selecting, creating, adding to and combining with control groups
- Add a ControlGroups widget to manage the player interaction
2022-01-28 18:38:18 +01:00
Gustas
04b456d6c2 Create overlays dropdown 2022-01-26 23:09:18 +01:00
Gustas
2f130b17ba Fix buildable overlay not updating and make ramps unbuildable 2022-01-23 22:37:02 +01:00
penev92
9cc631ca7e Added a rule about using object initializers 2022-01-23 13:14:57 +01:00
penev92
ab09ce21b4 Changed code to use object initializers everywhere 2022-01-23 13:14:57 +01:00
penev92
70e2769a85 Added a rule about the readonly modifier
Also added a rule to silence StyleCop complaining about StaticReadonlyFieldsMustBeginWithUpperCaseLetter to match what we already have configured for the IDE.
2022-01-22 18:47:06 +00:00
penev92
bf332b6619 Fixed fields missing the readonly modifier 2022-01-22 18:47:06 +00:00
Piotr Usewicz
f83e27d647 Point towards arm libraries
When compiling for macOS using `unix-generic` on Apple M1 processors, point sarchdirs towards the correct location in Homebrew for arm64.
2022-01-22 18:21:36 +00:00
penev92
a67cfabd1e Reordered code style rules
To order them by their number.
2022-01-20 22:10:28 +01:00
penev92
8dbaa0c49f Added more explanations to .editorconfig 2022-01-20 22:10:28 +01:00
penev92
92d1d64dce Changed one-liner braces rule to silent
Having this set to "none" disabled the IDE's option to add braces, whereas "silent" lets it do it on the user's request while still not suggesting it on its own.
2022-01-20 22:10:28 +01:00
penev92
31b3647c09 Added a rule about unordered modifiers 2022-01-20 22:10:28 +01:00
penev92
d37336456d Fixed inconsistent declaration modifier order 2022-01-20 22:10:28 +01:00
penev92
3bacd81b8b Added a rule about zero-length array allocations 2022-01-20 22:10:28 +01:00
penev92
0d24ccc47a Fixed unnecessary zero-length array allocations
Changed all currently present zero-length array allocations in the codebase to use `Array.Empty` instead.
2022-01-20 22:10:28 +01:00
Paul Chote
1312c1aa72 Rename macOS compat packages to mono. 2022-01-20 19:31:43 +01:00
penev92
19dd23e349 Beautified the .editorconfig file 2022-01-19 14:37:14 +01:00
dnqbob
242d589c45 Make AI airstrike aircraft spawns randomly 2022-01-17 15:43:20 +01:00
Mustafa Alperen Seki
d149624b84 Add Lua Scripting for Carryall. 2022-01-12 14:24:13 +01:00
penev92
860ec642b8 Addressed review comments
- Renamed `IVideo.CurrentFrameNumber` to `CurrentFrameIndex`
 - Improved logged error message in VideoPlayerWidget
 - Renumbered fields in ThreadedGraphicsContext
2022-01-11 18:16:31 +01:00
penev92
248b8d1102 Renamed IVideo implementations
To match the interface they are implementing.
2022-01-11 18:16:31 +01:00