Commit Graph

55 Commits

Author SHA1 Message Date
Paul Chote
71b61ad8ee Remove bogus and unnecessary Color[] FieldLoader override. 2019-03-12 12:44:29 +01:00
Paul Chote
3e404f6ac2 Remove HSLColor. 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
Paul Chote
94f7f6fd2e Remove obsolete code. 2019-02-24 14:02:19 +01:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
RoosterDragon
5bd5a384b7 Use a BitSet for representing target types.
- Rename Bits<T> to BitSet<T>.
- Implement set based helpers for BitSet<T>.
- When representing TargetTypes of ITargetable in various traits, use a BitSet<TargetableType> instead of HashSet<string> for better performance & reduced memory usage.
- Fix FieldLoader to trim input values when generating a BitSet<T>.
- Require T in BitSet<T> and BitSetAllocator<T> to be a class since it's just a marker value. This allows the JIT to instantiate generic code for these classes once, as they don't benefit from specialized code for T. (Typically JITs will generate shared code for all reference types, and unique code for every value type encountered).
2018-03-21 12:07:44 +01:00
abcdefg30
ed6a6b61de Throw a proper error when parsing an invalid int2 2018-03-09 23:32:07 +01:00
abcdefg30
56e7b1edc2 Fix int2 arrays not being parsed 2018-03-09 23:32:07 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
RoosterDragon
de38313579 Cache VariableExpressions on load.
Compiling these expressions is sadly expensive, and we needed new ones for every trait on every actor each time one was generated. The expressions thankfully can be shared as they are pure functions, which removes this overhead.
2017-12-17 01:42:21 +01:00
Paul Chote
2f79173044 Migrate hotkey consumers to HotkeyManager. 2017-12-08 01:29:15 +01:00
Paul Chote
c4237d6a1a Rename NamedHotkey to HotkeyReference. 2017-12-08 01:29:15 +01:00
Paul Chote
42bf232b37 Introduce NamedHotkey type. 2017-08-25 21:56:52 +02:00
Paul Chote
430429f337 Fix WRot FieldLoader parsing. 2017-05-14 11:52:42 +01:00
atlimit8
b0187dd646 Added (Boolean|Integer)Expression subclasses of VariableExpression 2017-04-11 02:52:54 -05:00
atlimit8
e73d3922dd Rename ConditionExpression => VariableExpression 2017-04-11 01:26:38 -05:00
atlimit8
d83dae5587 Rename BooleanExpression => ConditionExpression 2017-02-22 08:54:50 -06:00
Paul Chote
27cd31879f Add FieldLoader.AllowEmptyEntries attribute. 2017-01-30 18:22:44 +00:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Paul Chote
1cc7944437 Add FieldLoader and linter support for BooleanExpression. 2016-11-19 17:19:25 +00:00
Paul Chote
a8dda39a72 Introduce float3 type. 2016-04-10 09:41:01 -04:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
Paul Chote
8ade035049 Add support for loading CVec[] from yaml. 2016-01-25 09:14:00 +01:00
RoosterDragon
5f13fa0343 Fix serialization of custom exceptions. 2016-01-01 04:51:55 +00:00
RoosterDragon
bfe1804bf6 Fix some spellings. 2015-11-27 16:19:59 +00:00
atlimit8
dac15edce5 Load rgb[a] hex colors from MiniYaml (+ Lua) 2015-10-27 16:09:48 -05:00
atlimit8
079cff0a7a IRulesetLoaded Warhead support and better error messages. 2015-10-02 13:40:21 -05:00
Pavel Penev
8ddbabbfde Add Dictionary<,> support to FieldSaver 2015-09-01 22:52:20 +03:00
Pavel Penev
341b3395c8 Add Dictionary<,> support to FieldLoader 2015-09-01 22:52:18 +03:00
Pavel Penev
821e09877d Remove an assumption from FieldLoader.TryGetValueFromYaml() about the current value not having subnodes.
FieldLoader assumed the YAML that is being loaded is a simple value with no subnodes and threw an exception otherwise. This explicitly excluded the possibility of trying to load a Dictionary or another more complex object.
2015-09-01 22:52:04 +03:00
RoosterDragon
5a177a889c Add ability to load and save HashSets. 2015-08-27 21:48:09 +01:00
RoosterDragon
410b97823a Ensure our array handling only accepts single dimensional arrays. 2015-08-27 21:31:24 +01:00
atlimit8
7881ff40bf Added FieldLoader.SerializeAttribute.Required to require fields in MiniYaml 2015-07-12 12:44:22 -05:00
Matthias Mailänder
7447e0bf93 rename WRange to WDist 2015-07-09 10:55:38 +02:00
Matthias Mailänder
aab6d6d170 add addititional value null checks 2015-07-05 08:47:05 +02:00
Matthias Mailänder
10d76da61b fix a null reference exception 2015-07-04 09:43:31 +02:00
Matthias Mailänder
2763e26d23 add a take screenshot hotkey 2015-06-27 16:29:33 +02:00
RoosterDragon
d2d2f4a838 Made FieldLoader thread-safe, and cache some expensive reflection calls. 2015-04-25 18:55:46 +01:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
RoosterDragon
a6cda967c2 Formatted all files.
Automatically formatted all files via VS. This generally corrects indentation, removes trailing whitespace and corrects misplaced tabs or spaces. Manually tweaked a few files where required.
2015-01-06 21:28:50 +00:00
Matthias Mailänder
44cd174a8d StyleCop clean OpenRA.Game 2015-01-03 19:00:48 +01:00
Hellhake
5a97a4b63b Fix StyleCop warnings in OpenRA.Game 2015-01-02 12:11:01 +01:00
Paul Chote
118275b376 Add terrain geometry visualisation. 2014-11-07 19:18:34 +13:00
UberWaffe
c972b39687 Custom Warheads refactor
Changes included:

Warhead code split out of weapon code and refactored.
Warhead functionality now split into several classes, each handling one effect/impact.

Additional custom warheads can now be defined and called via yaml.
Custom warheads inherit the abstract class Warhead,
which provides target check functions.

Custom warheads have to define their own impact functions,
and can also define their own replacement for check
functions.
2014-08-03 17:10:44 +02:00
atlimit8
d79ab8070d Added the abiltity to load WVec[] from MiniYaml 2014-07-30 14:34:28 -05:00
Pavlos Touboulidis
dcb7a44aa2 Use available TypeConverters to serialize and deserialize types 2014-07-12 04:46:45 +03:00
Pavlos Touboulidis
e9dd0b0fab Make FieldLoader/FieldSaver able to work with private fields
* Unify the FieldLoader-related attributes (Ignore, LoadUsing,
FieldFromYamlKey) into a new 'Serialize' attribute. Keep the
previous attributes as shortcuts/aliases to the new attribute.

* Add 'YamlName' field to the new 'Serialize' attribute to allow
yaml names different from the field names. Example:
    [Serialize(YamlName = "Width")]
    private int widthExpression = "0";

* The FieldLoader will treat private fields like public now and
will try to load their values. The FieldSaver gets an optional
parameter specifying whether to save private fields by default.
The 'Serialize' attribute can be used to fine-tune individual
fields.

* Updated the traits documentation exporter to write the yaml
name if it has been overriden.
2014-07-12 04:33:36 +03:00
ScottNZ
90894aa03e Use var everywhere 2014-06-15 22:17:34 +12:00
RoosterDragon
b733465f33 General uncontroversial cleanup:
- Made private methods static where possible (runtime can elide checking the object for null).
- Declared attribute classes as sealed (allows reflection on attributes to complete faster).
- Moved some static cctor's into field initializers (static cctor's are slower than static field initializers).
- Made classes static if they contained only static methods (can't create instances of useless objects).
- Use inferable Exts.Lazy and not new Lazy<T>().
- Added required STAThread attribute to CrashDialog.
- Removed unused parameters in private methods.
- Added Serializable attribute to exceptions.
- Added parameter name in calls to ArgumentNullException.
- Use of as operator instead of is + cast.
- Changed (x as Foo).Bar anti-pattern into ((Foo)x).Bar. Results in sensible cast exceptions on error rather than null dereferences.
- Removed unused method in NullShader.
2014-05-23 15:50:54 +01:00