Commit Graph

1054 Commits

Author SHA1 Message Date
abcdefg30
42954aa18e Remove BagFile 2018-04-11 17:18:03 +02:00
RoosterDragon
4da9b6f00a Ensure BagFile.GetStream returns unique streams.
GetStream must return a unique stream on each call to ensure multiple callers can read their streams without affecting each other. As bag file returned multiple references to the same underlying stream, it was possible for multiple callers to disturb reads of each other, and thus read bad audio from each file.
2018-04-10 22:09:39 +02:00
Chris Forbes
dddd057e3d Add IPositionable.CanExistInCell
This is like CanEnterCell, but doesn't take into account conflicting
actors, etc.
2018-04-10 01:01:53 +02:00
Paul Chote
4f0aa89c01 Remove TileSet.Palette and PaletteFromCurrentTileset. 2018-04-08 21:14:29 +02: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
RoosterDragon
d2f2029caf Add FirstNonEmptyBounds method for IDecorationBounds interface.
This provides a more efficient way of determining the bounds by avoiding LINQ. A helper that works directly on arrays prevents allocation of an enumerator when the collection is know to be an array.
2018-03-18 22:06:12 +01:00
RoosterDragon
63810220e4 Improve some usages of Aggregate. 2018-03-18 16:44:17 +01:00
Mustafa Alperen Seki
5e7e3bb011 Add DamageTypes to Kill() and make some traits use it. 2018-03-09 00:25:29 +01:00
reaperrr
d90ff99e74 Replace WithReloadingSpriteTurret with conditions
WithReloadingSpriteTurret was bound to run into conflicts with any WithTurret*Animation traits due to overriding the turret sequence constantly via ITick.
Using (stacked) conditions instead avoids that.
2018-03-08 16:03:14 +01:00
Paul Chote
e69cf4fd5c Rename another Stream.Write(byte[]) extension method. 2018-03-07 22:29:35 +01:00
Peter Antal
9ce0bcb0b7 Mop up active Stylecop nits.
Style consistency cleanup.
2018-03-03 11:45:35 +00:00
reaperrr
9107ca3bc1 Remove unused legacy IsWater flag
This was planned anyway, we had just forgotten about it when the last blocker was removed.
2018-02-22 11:51:10 +01:00
Paul Chote
2fccfdf1ee Add support for disabling IIssueDeployOrders. 2018-01-28 18:06:30 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Paul Chote
ee728be537 Fix WithCargo crash. 2018-01-01 19:25:50 +01:00
Paul Chote
cd6dfd2185 Work around the "BUG: in order targeter" game chat warning. 2018-01-01 10:48:03 +01:00
Paul Chote
e70b61c4b0 Fix Chrono Tanks telesporting towards (0,0) when force-moving to an actor. 2018-01-01 10:48:03 +01:00
reaperrr
b70e4de5ee Refactor support powers to use ticks instead of seconds for all delays - code changes
Also renamed ChargeTime to ChargeInterval.
2017-12-28 10:04:43 +00:00
Mustafa Alperen Seki
fc07391c8c Add Type Support for InfiltrateFor* traits 2017-12-27 11:13:09 +00:00
reaperrr
04fb0f209d Spatially partition some actor overlays 2017-12-23 17:56:11 +00:00
RoosterDragon
ca01a1f186 Presize MemoryStream when possible.
Also use GetBuffer when we know we have presized the stream to the exact required size to prevent a needless copy.
2017-12-19 00:59:11 +01:00
reaperrr
383840135f Replace IsDisabled checks in production with IsTraitPaused/Disabled checks
Note: We might want to separate IsTraitDisabled checks later (possibly make the latter cancel the currently produced item), but that can be done in a follow-up.
2017-12-17 21:18:44 +00:00
GSonderling
488cec64b8 Added support for filtering exits by production type. 2017-12-13 04:08:52 +01:00
Paul Chote
c87409ed1a Remove legacy bounds code. 2017-12-11 19:45:07 +01:00
Paul Chote
ff5b4b15b3 Introduce IDecorationBounds to replace Actor.SelectionOverlayBounds. 2017-12-11 19:45:07 +01:00
Paul Chote
6f5d035e79 Introduce IMouseBounds and split/rework mouse rectangles.
The render bounds for an actor now include the area covered
by bibs, shadows, and any other widgets. In many cases this
area is much larger than we really want to consider for
tooltips and mouse selection.

An optional Margin is added to Selectable to support cases
like infantry, where we want the mouse area of the actor
to be larger than the drawn selection box.
2017-12-11 19:45:07 +01:00
Paul Chote
8fcc80b05a Use IRender.ScreenBounds in ScreenMap.
Traits are now required to trigger a ScreenMap update whenever they
believe that their ScreenBounds have changed.
2017-12-11 19:45:07 +01:00
Paul Chote
86bfe28ade Add ScreenBounds method to IRender interface.
This method is expected to return Rectangles that cover
the region where Renderables returned by Render may exist.
2017-12-11 19:45:07 +01:00
Paul Chote
29255c8e01 Add IModel.AggregateBounds and ModelAnimation.ScreenBounds.
The bounds define the smallest Rectangle that covers all
rotations of all frames within a model sequence.
2017-12-11 19:45:07 +01:00
RoosterDragon
62ab6ae6f1 OccupiedCells and TargetableCells must return arrays, not just enumerables.
This allows callers to efficiently enumerate these returned collections without the allocation and overhead imposed by the IEnumerable interface. All implementations were already returning arrays, so this only required a signature change.
2017-12-07 20:39:30 +02:00
RoosterDragon
6a97502e09 Reuse buffers when loading Xcc databases.
We can reuse the list as a buffer when reading strings to avoid throwaway allocations, which will reduce GC pressure during loading.
2017-11-30 02:16:51 +02:00
reaperrr
c48ddbdfa5 Fix Mammoth Mk2 render bounds
And polish trait internals a little.
2017-11-29 11:39:24 +02:00
reaperrr
d21992130a Fix TS harvester render bounds 2017-11-29 11:39:24 +02:00
abcdefg30
ed67cea852 Fix a crash in Disguise.cs when order.TargetActor is null 2017-11-26 18:41:53 +01:00
abcdefg30
c83dda4ce7 Initialize AsActor as self.Info 2017-11-26 18:41:53 +01:00
abcdefg30
4c707ad6a6 Fix WithDisguisingInfantryBody crashing when losing the disguise 2017-11-26 18:41:53 +01:00
Paul Chote
b898b5001a Rename AttackBase.IsAttacking to IsAiming to make its uses and assumptions clear. 2017-11-26 15:58:00 +01:00
Mustafa Alperen Seki
f35f6c0813 Move Sprite handling from Disguise to WithDisguisingInfantryBody 2017-11-15 15:48:24 +00:00
Mustafa Alperen Seki
ecdfcda43e Add DisguisedAsCondition 2017-11-15 15:48:24 +00:00
Mustafa Alperen Seki
bb600620a9 Add ShowTicks to InfiltrateForCash 2017-11-15 15:16:39 +01:00
reaperrr
8b7a71685c Remove AmmoPool-awareness from Armament 2017-11-12 19:48:06 +00:00
Andrii Yukhymchak
f4dbf55510 Chrono into map edge fix 2017-11-12 18:23:17 +00:00
Paul Chote
4fe7ffed85 Simplify and fix code quality in GpsDot. 2017-11-03 09:56:00 +01:00
Paul Chote
1376ad674e Remove Player.CanViewActor and .CanTargetActor. 2017-11-03 09:56:00 +01:00
Paul Chote
47634b25f9 Remove IFogVisibilityModifier. 2017-11-03 09:56:00 +01:00
Paul Chote
4dba9f5b88 Add RevealDisguiseType.Move. 2017-11-03 09:30:50 +01:00
Paul Chote
7afd219742 Expose Disguise ValidStances and TargetTypes to yaml. 2017-11-03 09:30:50 +01:00
Paul Chote
c9c7c5744c Explicitly implement interfaces in Disguise trait. 2017-11-03 09:30:50 +01:00
Paul Chote
5f9a67ed87 Migrate frozen actors from ExtraData to Target. 2017-10-26 18:48:41 +03:00
Paul Chote
cfac996438 Generalize factionVariant to a TypeDictionary of Inits. 2017-10-22 03:32:21 +03:00