Commit Graph

440 Commits

Author SHA1 Message Date
Paul Chote
62b5d22e53 Add INotify(Activity)StanceChanged interfaces. 2019-05-21 15:52:55 +02:00
Paul Chote
1f3b30c2d2 Implement game save/load backend. 2019-04-20 14:54:48 +02:00
Mustafa Alperen Seki
9fef2c01ec Add AppearsOnMapPreview
Allows preplaced actors to be rendered on map preview when saving the
map.

Also removes requirements for ResourceLayer in OpenRA.Game and moves it
to OpenRA.Mods.Common.
2019-04-04 19:37:19 +02: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
Andre Mohren
42446ac9ba Implemented trait defined Rollovers. 2019-02-22 21:15:33 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
reaperrr
54c2894b4e Split off last bot modules
And dissolve AI namespace.
There would have been so little left in Common.AI,
that keeping it made no sense anymore.
2018-12-31 10:56:01 +00:00
Paul Chote
f6768fe624 Remove legacy editor actor properties plumbing. 2018-12-08 22:53:13 +01:00
reaperrr
67cba65800 Fix bot module plumbing
Fixes the issues pointed out after the original harvester module was merged.
Also merges the update rules as discussed on IRC.
2018-11-24 11:05:37 +00:00
Andre Mohren
b1a44086a0 Removed unused using directives. 2018-11-17 17:23:22 +00:00
Paul Chote
a06cfb4004 Move TerrainRenderer to a mod-defined trait. 2018-10-13 18:16:56 +02:00
Andre Mohren
450dc70375 Refactored cursors.yaml to use palettes from rules. 2018-10-07 19:28:11 +02:00
teinarss
e353c8c176 Changed SubCell to byte 2018-09-30 19:48:27 +01:00
Andre Mohren
640078a2b1 Refactored Health usage to IHealth. 2018-09-29 18:12:40 +02:00
Chris Forbes
d4ef841678 Convert masses of HashSet<string> to BitSet<DamageType> 2018-07-28 20:12:42 +01:00
Paul Chote
ebf3ec0e90 Add some basic safeguards around RenderPlayer.set. 2018-05-31 18:54:07 +02:00
Mustafa Alperen Seki
367a7f617c Added OwnerLostAction
Allows customisation of what will happen to an actor when its owner
loses.
2018-05-28 10:42:45 +01:00
reaperrr
45ee4ad4cf Move IOccupySpace interface right above IPositionable in TraitsInterfaces 2018-05-07 19:40:07 +02:00
reaperrr
3c34330925 Skip check for ITemporaryBlocker entirely if rules don't contain any temporary blockers
This benefits all mods without temporary blockers like gates or energy walls.
2018-05-04 19:40:18 +02:00
reaperrr
ccd070afd6 Make IRenderModifier require explicit implementation 2018-04-29 11:59:49 +01:00
reaperrr
06dbf71461 Make IStoreResources require explicit implementation 2018-04-29 11:59:49 +01:00
reaperrr
cc4c5a5492 Make IVoiced require explicit implementation 2018-04-29 11:59:49 +01:00
reaperrr
18ed04eab5 Only use largest blocker instead of largest actor for projectile blocker overscan
Before this, we unconditionally used the largest OuterRadius of all actors inside a mod for overscanning of blockable projectiles.
However, in many mods the only blockable actors are 1-cell walls, and even if there are gates like in TS, they usually aren't the largest actors in terms of hit-shape.

So this measure should save a bit of performance by reducing the overscan radius of blockable projectiles, especially in mods where walls are the only blocking actors.
2018-04-22 10:55:23 +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
reaperrr
0c52ff3ae5 Cache TargetablePositions in Actor
To speed up Target.Positions.
2018-04-07 17:24:13 +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
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
Mustafa Alperen Seki
5e7e3bb011 Add DamageTypes to Kill() and make some traits use it. 2018-03-09 00:25:29 +01:00
Alexis Hunt
08ad7d7f4e Refactor handling of hit radii in projectiles.
penev discovered that the RulesetLoaded functions of projectiles were
never being called, meaning that their blocking calculations were not
properly accounting for actors with large hitboxes.

The best fix for this is to change FindActorsOnLine to always account
for the largest actor's hit radius, rather than forcing callers to pass
the largest radius. Per the comment in Util.cs, as a result, move this
computation to ActorMap. I decided to simplify by not making a separate
calculation for actors that block projectiles only; this may cause a
small performance degradation as the search space is a bit larger.

Similarly to this, I've removed the ability to specify a search radius
manually. Because this is only a search radius, setting a value smaller
than the largest eligible actor makes no sense; that would lead to
completely inconsistent blocking. Setting a larger value, on the other
hand, would make no difference.

CreateEffectWarhead was the only place in core code any of these search
radii were set, and that's because 0 was a mysterious magic value that
made the warhead incapable of hitting actors. I replaced it with a
boolean flag that more clearly indicates the actual behaviour.

Fixes #14151.
2018-02-21 23:26:41 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
reaperrr
04fb0f209d Spatially partition some actor overlays 2017-12-23 17:56:11 +00:00
Paul Chote
e35e93557c Remove obsolete NearestCellTo helper. 2017-12-18 07:47:15 +00:00
reaperrr
01a88862b3 Remove IDisable for good 2017-12-17 21:18:44 +00:00
Paul Chote
3f67feab0e Rename boolean LobbyOption fields. 2017-12-12 22:43:11 +01:00
Paul Chote
97cdce7448 Add additional metadata to lobby options. 2017-12-12 22:43:11 +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
fa65fef4d1 Add IRenderModifier.ModifyScreenBounds to support WithShadow. 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
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
reaperrr
56b6aabbb8 Use new IAutoRenderSize for determining actor render bounds 2017-11-21 01:00:09 +02:00
Paul Chote
47634b25f9 Remove IFogVisibilityModifier. 2017-11-03 09:56:00 +01:00
reaperrr
8533debc44 Require explicit INotifyAddedToWorld and INotifyRemovedFromWorld 2017-10-07 10:17:11 +02:00
reaperrr
8ec3d5ddb8 Require explicit ITickRender 2017-10-07 10:17:11 +02:00
reaperrr
0ce3c113e1 Require explicit ITargetableCells 2017-10-07 10:17:11 +02:00
reaperrr
7ca9679b34 Require explicit ITargetablePositions 2017-10-07 10:17:11 +02:00
reaperrr
9aaf800bca Require explicit INotifyActorDisposing 2017-09-28 13:14:08 +02:00
reaperrr
5026dfe5d3 Require explicit INotifyCreated 2017-09-28 13:14:08 +02:00