Commit Graph

118 Commits

Author SHA1 Message Date
RoosterDragon
c9ee902510 Fix issues preventing suboptimal path searches.
Two different issues were causing a path search to not explore cells in order of the cheapest estimated route first. This meant the search could sometimes miss a cheaper route and return a suboptimal path.

- PriorityQueue had a bug which would cause it to not check some elements when restoring the heap property of its internal data structure. Failing to do this would invalidate the heap property, meaning it would not longer return the items in correct priority order. Additional tests ensure this is covered.
- When a path search encountered the same cell again with a lower cost, it would not update the priority queue with the new cost. This meant the cell was not explored early enough as it was in the queue with its original, higher cost. Exploring other paths might close off surrounding cells, preventing the cell with the lower cost from progressing. Instead we now add a duplicate with the lower cost to ensure it gets explored at the right time. We remove the duplicate with the higher cost in CanExpand by checking for already Closed cells.
2022-06-07 15:47:02 +02:00
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
RoosterDragon
2583a7af31 After NotBefore<> support to control initialization order.
Requires<T> means that trait of type T will be initialized first, and asserts that at least one exists. The new NotBefore<T> means that trait of type T will be initialized first, but allows no traits.

This allows traits to control initialization order for optional dependencies. They want to be initialized second so they can rely on the dependencies having been initialized. But if the dependencies are optional then to not throw if none are present.

We apply this to Locomotor which was previously using AddFrameEndTask to work around trait order initialization. This improves the user experience as the initialization is applied whilst the loading screen is still visible, rather than the game starting and creating jank by performing initialization on the first tick.
2022-04-18 10:31:47 +01:00
penev92
bf332b6619 Fixed fields missing the readonly modifier 2022-01-22 18:47:06 +00:00
abcdefg30
bf7ec4aec1 Update nuget packages 2022-01-04 12:34:30 +01:00
Matthias Mailänder
1c00a2fbec Bump NUnit slightly. 2021-12-27 22:33:06 +01:00
RoosterDragon
727084c5fc Run spell check over solution 2021-12-05 19:23:43 +01:00
RoosterDragon
1d23c23d06 Adjust span comparisons for clarity and add some test cases. 2021-11-15 13:20:34 +01:00
RoosterDragon
0f01df5474 Avoid string allocations in MiniYaml parsing.
- Stream lines in as memory rather than needing to realise a string for each line, via a new method in StreamExts.
- Use span to avoid string allocations during parsing until we want to realise the node itself, in MiniYaml.FromLines.
- Change several callsites to use the streaming extension method rather than string method where possible.
2021-11-15 13:20:34 +01:00
penev92
8ba6d13b2f Removed unused using directives 2021-10-15 13:12:33 +02:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
CrazyAlex25
2d05e10819 Modify build properties 2021-04-12 00:44:17 +02:00
teinarss
e12ff2c59d Remove our own ReadOnlyDictionary and update usages 2021-04-03 11:33:31 +02:00
teinarss
5e74e58b22 Add support for dotnet core for Windows 2021-01-01 19:42:01 +01:00
Paul Chote
20fe59e844 Output compiled binaries to ./bin. 2020-11-24 17:53:48 +01:00
Paul Chote
dd0b08d54a Replace ^ and . in platform paths with ^SupportDir and ^EngineDir. 2020-11-24 17:53:48 +01:00
Paul Chote
1cc1f93fb0 Rename Platform.GameDir to Platform.EngineDir. 2020-11-24 17:53:48 +01:00
Paul Chote
72f1f06ebc Remove Platform.UnresolvePath. 2020-11-22 16:42:46 +01:00
teinarss
19b02875c7 Use Tuple syntax 2020-08-15 10:37:10 +01:00
Paul Chote
86f61298e6 Replace ITraitInfo interface with TraitInfo class. 2020-05-21 13:01:04 +02:00
teinarss
85096c4ba2 Update CoordinateTest to be compatible with new nunit version. 2020-04-18 11:36:25 -05:00
teinarss
e13fd693c3 Add Nuget packages for all dependencies 2020-04-18 11:36:25 -05:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
Paul Chote
0b8a367867 Fix MiniYaml parsing of empty comments 2019-12-28 19:15:36 +01:00
Paul Chote
ebf2ce32c0 Make sure braces for multi-line statements are on their own lines. 2019-06-08 19:26:53 +02:00
Paul Chote
4f7dca809f Fix csproj formatting. 2019-05-26 23:13:37 +02:00
Paul Chote
845fca25d1 Change platform from x86 to Any CPU (preferring 64 bit)
A Release-x86 configuration allows x86 Windows installers to still be created.
2019-05-26 23:13:37 +02:00
Paul Chote
ba282865f1 Replace legacy StyleCop(Plus) with StyleCopAnalyzers
Analyzers are enabled in the Debug configuration
only to avoid unnecessary overheads when compiling
normally.
2019-05-09 20:40:08 +02:00
Paul Chote
ac8252531b Fix solution listings in the Rider IDE. 2019-05-05 23:19:04 +02:00
Paul Chote
1955cac84e Unify Windows and mono build systems.
The Makefile behaviour is recreated using the new and significantly
cleaner .NET Core csproj format.

fixheader.exe is promoted to OpenRA.PostProcess.exe and now runs
on all platforms.
2019-05-05 23:19:04 +02:00
Paul Chote
2a085945df Add terminating newline to yaml strings. 2019-05-02 13:40:22 +02:00
Paul Chote
4886cca5d3 Remove System.Drawing references from mod code. 2019-03-04 18:26:42 +00:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Andre Mohren
89051d40e8 Remove utf8 BOM. 2018-11-17 17:23:22 +00:00
Andre Mohren
7323db1492 Unified copyright regions. 2018-11-17 17:23:22 +00:00
Andre Mohren
b1a44086a0 Removed unused using directives. 2018-11-17 17:23:22 +00:00
Paul Chote
eb0e2eeb9d Fix misc indentation errors. 2018-10-06 23:32:38 +02:00
teinarss
cfaf5a6467 Updated CPos struct to use a bit field for all properties. 2018-10-02 00:54:45 +01:00
abcdefg30
5d1c37a4c5 Remove the CodeAnalysisRuleSet property from all csproj files 2018-08-25 22:02:59 +02:00
Paul Chote
f4d3ccc301 Fix newlines in misc other files. 2018-07-01 11:08:32 +02:00
Paul Chote
670e153372 Remove byte order marks from csproj files. 2018-07-01 11:08:32 +02:00
abcdefg30
e83f5a9d59 Replace "\r\n" by "\n" in unit tests 2018-05-20 22:44:34 +02:00
Paul Chote
ba9d1c3182 Improve MiniYaml nunit tests:
- Fixes incorrectly used variable.
- Adds additional tests for node positions.
2018-05-20 22:44:34 +02:00
Paul Chote
df31690332 Extend MiniYaml parser with new features:
- Add support for escaping '#' inside values
- Add support for escaping leading and trailing whitespace

And when discardCommentsAndWhitespace is set to false:
- Add proper support for comments
- Persist empty lines

Whitespace and comment support requires an explicit opt-in because
they produce MiniYamlNodes with null keys.  Supporting these through
the entire game engine would require changing all yaml enumerations
to explicitly check and account for these keys with no benefit.

Comments and whitespace are now treated as real nodes during parsing,
which means that the yaml parser will throw errors if they have
incorrect indentation, even if these nodes will be discarded.
2018-05-12 16:42:54 +02:00
atlimit8
7283f9804e Added Polygon IHitShape 2018-03-09 23:32:07 +01:00
RoosterDragon
a726b57367 Fix order serialization issues. 2018-01-28 15:41:28 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
RoosterDragon
3a9abda441 Specify C# 5 as the language version used in all projects.
Attempts to use features from a new version will generate compile errors (on Roslyn and possibly other compilers), preventing accidental adoption of new language features.
2017-10-19 14:18:03 +02:00
Paul Chote
d967c564a2 Remove TargetActor and TargetLocation from order issuing. 2017-10-15 19:07:46 +02:00