Commit Graph

114 Commits

Author SHA1 Message Date
Paul Chote
086ec07eb6 Add World parameter to Target.FromCell. 2014-06-27 23:30:40 +12:00
Paul Chote
5560f276ca Map: Rename IsInMap -> Contains. 2014-06-27 22:07:03 +12:00
Paul Chote
2026747f2a Use Map.IsInMap(CPos) for things that are checking CPos. 2014-06-27 19:20:46 +12:00
Paul Chote
58c3f9ad0c Use MoveWithinRange for attack activities.
Fixes #2104. Fixes #2923. Fixes #4455.
2014-06-15 22:48:43 +12:00
Paul Chote
887a515e14 Add MinRange plumbing to attack activities. 2014-06-15 22:48:43 +12:00
ScottNZ
90894aa03e Use var everywhere 2014-06-15 22:17:34 +12:00
Pavlos Touboulidis
060d5326ed Move FindTilesInCircle from WorldUtils to Map 2014-06-13 14:24:53 +03:00
Pavlos Touboulidis
77fb188585 Move ClampToWorld from WorldUtils to Map 2014-06-13 13:59:40 +03:00
Pavlos Touboulidis
c282fa1077 Move GetTerrainIndex/Info from WorldUtils to Map 2014-06-13 13:57:32 +03:00
Pavlos Touboulidis
092352729f Change terrain type from string based dictionaries to arrays 2014-06-13 11:20:54 +03:00
RoosterDragon
2e992a7310 Changed MiniYaml.NodesDict property into a method.
Method is now called ToDictionary.
- Cached a few invocations into locals which should prevent some redundant evaluation.
- Added ToDictionary overloads that take projection functions for the keys and elements, since several callsites were doing a subsequent Linq.ToDictionary call to get this.
2014-06-09 17:06:42 +01:00
RoosterDragon
0c8bdff5be Formatting fixes.
Spaces to tabs, indents, etc.
2014-05-26 18:10:59 +01:00
RoosterDragon
a0db80cb6a Changes to reduce allocations in the main loop.
Targeted some methods that generated allocated a lot of memory in the main game loop:
- Actor.Render - Changed LINQ calls into equivalent loops. No allocation for delegates.
- Animation.Render - Returned an array rather than a yield expression. The array uses less memory than the complier generated enumerable.
- FrozenActor and FrozenUnderFog - Materialize the footprint into an array: The enumerable is not-trivial to evaluate is and evaluated many times inside the Tick function. The memory needed is minimal. Changed LINQ into equivalent loops to prevent delegate allocation. Should result in overall much faster calls.
- Widget.GetEventBounds - Changed LINQ calls into equivalent loops.
- MobileInfo.CanEnterCell - Changed LINQ calls into equivalent loops. Don't materialize list of blocking actors every time, instead enumerate them and only when they need to be checked.
- FrozenUnderFog.TickRender - Generate the renderables lazily and also remove a no-op Select call.
2014-05-23 14:48:11 +01:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Paul Chote
ac5a4589ea Add IMove.MoveIntoWorld and IMove.VisualMove. 2014-03-19 13:40:32 +13:00
Ian T. Jacobsen
3c80024113 Made Move::NotifyBlocker handle traits appropriately 2014-02-09 15:50:49 +00:00
Ian T. Jacobsen
2f2afd9fc5 Added OnNotifyBlockingMove to Mobile 2014-02-09 13:52:40 +00:00
Taryn
9c4ad15d1e Changed most references of trait Mobile -> IMove.
In Mobile.cs IsMoving now has a public set as opposed to the initial internal. 
Added IMoveInfo interface to go with *Info classes that require IMove.
WithRotor now uses IMove.IsMoving instead of (self.CenterPosition.Z > 0) as part of a check.
2014-02-02 15:13:49 -06:00
Paul Chote
1759d73ed7 Add following to IMove. 2014-02-01 10:55:05 +13:00
Paul Chote
512358eb72 Disable Move OrderTargeter if the Move order is rejected. 2013-12-30 08:54:02 +01:00
Paul Chote
0b8dafcdf0 Convert actor speed to world coordinates. 2013-12-26 19:45:13 +13:00
Paul Chote
aa2f865d5d Convert Altitude to world coords.
Removes the obsolete AltitudeInit: use CenterPositionInit instead.
2013-12-26 17:25:07 +13:00
Matthias Mailänder
73750f5a7c StyleCop cleanup 2013-11-02 18:03:55 +01:00
Paul Chote
e03ec690ff Track actor positions in ActorMap. 2013-09-27 15:36:51 +12:00
Paul Chote
b00cc6108d Make ActorMap addition explicit. 2013-09-27 15:36:51 +12:00
Paul Chote
dfd51c0caa Introduce ScreenMap trait for caching screen-coord queries. 2013-09-27 15:36:25 +12:00
Paul Chote
bc5c11e44f Check ITargetable when deciding target validity. Fixes #3659. 2013-08-22 19:29:05 +12:00
Paul Chote
e4d1c654ed Merge IOrderTargeter.CanTargetActor and CanTargetLocation. 2013-08-11 22:23:52 +12:00
Paul Chote
3b3e6edc90 Add IMove interface.
Fixes Rallypoints for aircraft.
2013-08-11 00:28:31 +12:00
Paul Chote
c3f04cc32e Convert non-aircraft positioning to world coords.
This removes the incomplete and unused hover code
on Mobile, which would be more trouble that it is
currently worth to carry over.
2013-07-21 17:35:47 +12:00
Paul Chote
6a435752fd Remove *PxPosition from IOccupySpace/IPositionable. 2013-07-21 17:35:46 +12:00
Paul Chote
19165d259d Add world coord overloads to IOccupySpace and IPositionable. 2013-07-21 17:35:46 +12:00
Paul Chote
3e9bc63d4e Prevent things from tweaking mobile position directly. 2013-07-21 17:35:45 +12:00
Paul Chote
0676116d77 Convert Move and related plumbing to world coordinates. 2013-07-21 17:35:45 +12:00
Paul Chote
048bed0a5e Rename ITeleportable -> IPositionable. 2013-07-21 17:35:41 +12:00
Paul Chote
ecc119cb29 Combine IHasLocation -> IOccupySpace, IMove -> ITeleportable. 2013-07-21 17:33:32 +12:00
Paul Chote
2091a386fb Improve support for picking a valid actor spawn cell. 2013-07-13 19:18:26 +12:00
Paul Chote
91698678a2 Use WRange for Mobile.MoveWithinRange. 2013-07-10 19:59:03 +12:00
Paul Chote
0fdffd7b6a Convert Drag to world coords. 2013-07-08 21:52:27 +12:00
Paul Chote
9eaeeffae9 CenterLocation.ToCPos() -> CenterPosition.ToCPos(). 2013-07-08 21:52:26 +12:00
Paul Chote
561cb6cfe0 Rewrite Leap activity to be more robust.
The dog will now always leap to the target
subcell (even if the target dies or moves),
and will kill whatever happens to be in the
target cell when it lands.
2013-07-08 21:52:25 +12:00
Paul Chote
82b7854ed7 Make MobileInfo.SubCellOffsets static. 2013-07-08 21:52:25 +12:00
Chris Forbes
c0e0efd0ef movement equivalence classes
These can be used as a basis for a bunch of pathing optimizations.

- Feasability of movement can be precomputed for each class, avoiding
  the worst-case pathfinding behavior

- A path could potentially be shared between all members of a class.
  This isnt necessarily the best path for any single unit, as it
  doesn't care about efficiency of movement across various terrain --
  but it would be a "reasonable" path that the whole group could take
  together.

- General pathing checks can be converted from intersection of sets of
  strings to a simple AND.

- Other, wilder things.

V2: be paranoid about too-long bit vectors.
2013-06-26 20:50:51 +12:00
Scott_NZ
ac430bd3bc Add force-move 2013-05-18 17:52:36 +12:00
Paul Chote
55d5db0f02 Set produced unit position via an ActorInitializer. Fixes #3214. 2013-05-04 12:11:43 +12:00
Chris Forbes
a13f9ea3eb Revert "Fix bogus pathability check."
This reverts commit 8676562d47.
2013-04-21 13:58:10 +12:00
Chris Forbes
9a65399fed unlag move order response 2013-04-20 21:34:03 +12:00
Paul Chote
8676562d47 Fix bogus pathability check.
This fixes units on pathable bridge tiles from
being killed on bridge death (they were failing
the check against themselves).
2013-04-15 08:04:44 +12:00
Paul Chote
9b7bb53287 LocalPlayer.Shroud is never the right shroud. 2013-04-10 21:42:30 +12:00
Matthias Mailänder
c731a7960e embed the previously manually edited outdated documentation
from https://github.com/OpenRA/OpenRA/wiki/Trait-Documentation
2013-03-20 21:20:27 +01:00