Chris Forbes
f4e5c63408
Pathfinder: Only consider useful neighbors
...
Depending on the direction we came from, many neighbors are completely
useless. This is the first step to implementing the ideas in 'Jump Point
Search'
V2: Added comment describing what the array is for.
2014-11-23 15:09:48 +13:00
Chris Forbes
c470945db7
Remove vestigial direction-sorting machinery from PathSearch
2014-11-23 15:09:48 +13:00
Paul Chote
ab2bc789ce
TileSet cleanups.
2014-11-05 09:39:54 +13:00
huwpascoe
aae4aa3f24
Fixed ICrushable not being triggered properly
2014-10-16 05:11:16 +01:00
RoosterDragon
59b3cd154d
Change indexes into tile arrays to be stored as bytes to save memory.
...
The index value needs only be big enough to handle all defined terrain types. This is a low number so we can save memory by defining it as a byte. This particularly saves memory for the CustomTerrain field in the Map class, which defines a cell layer for the map using tile indexes, so we can reduce the size of that layer 4x as a result.
2014-10-09 20:03:01 +01:00
Paul Chote
6b54575569
Fix Move activity ignoring IDisableMove.
2014-10-07 19:30:24 +13:00
Paul Chote
34eb634779
Add self argument to Move constructors.
2014-10-07 19:30:23 +13:00
Matthias Mailänder
6a8345b3d0
document traits with generic names
2014-10-05 17:58:43 +02:00
atlimit8
3f6e1a608a
Added IDisableMove
2014-10-03 08:07:05 -05:00
atlimit8
83acbe0266
Extended IMove for Enter logic
2014-10-02 20:47:28 -05:00
atlimit8
8ad1140921
Reduce ICrushable trait lookup & drop -SubCell suffix.
...
Replace `a.HasTrait<ICrushable>()` with a.TraitsImplementing<ICrushable>().Any() or equivalent.
2014-08-30 04:43:57 -05:00
atlimit8
e29b9edfc1
Changes to map.cs, rename IPositionable.IsLeaving{ => Cell}, add IPositionable.GetValidSubCell
2014-08-29 23:30:16 -05:00
atlimit8
63c28ee4d7
Refactored in new enum SubCell
2014-08-29 23:00:53 -05:00
atlimit8
27ad5208fb
Fixed Mobile.SetPosition & other FixUnloadCargo touch-ups
...
Fixed Mobile.SetPosition
Finally removed old SubCell enum
Folded MobileInfo.CanEnterCell overloads into one
Renamed IPositionable.{IsMovingFrom => IsLeaving}
Changed Crate.IsLeaving to use crate lifetime
2014-08-29 23:00:53 -05:00
atlimit8
b2c9064545
Refactored [sub-]cell availability logic in IPositionable & ActorMap
...
Moved the logic from IPositionable.CanEnterCell & integrated sub-cell selection.
Added IPositionable.IsMovingFrom(CPos location, int subCell = -1) - to detect transient actors
Renamed IPositionable.{GetDesiredSubcell => GetAvailableSubcell} - since it checks for available sub-cells
Reduced IPositionable.CanEnterCell to one method that usually uses IPositionable.GetAvailableSubcell
Added actor checking to ActorMap.{HasFreeSubCell, FreeSubCell, AnyUnitsAt} - used by [sub-]cell availability logic
2014-08-29 23:00:53 -05:00
atlimit8
ff7ad53dee
Fixed UnloadCargo stacking using new subcell API exposure
2014-08-29 23:00:53 -05:00
atlimit8
9efcf231e1
Refactor MobileInfo.CanEnterCell
2014-08-29 23:00:53 -05:00
atlimit8
fe57417aa8
Added int subCell = -1 to IMove.MoveIntoWorld & IPositionable.SetPosition(Actor self, CPos cell)
2014-08-29 23:00:53 -05:00
Alexander Fast
070d00c678
Fixes year numbers in license text in file headers.
2014-08-21 11:27:52 +02:00
Paul Chote
84d3497e96
Convert speed modifiers to integer percentages.
2014-08-12 11:41:09 +12:00
atlimit8
898bf4959a
Remove sub-cell offset bounds checking
2014-08-04 18:09:26 -05:00
atlimit8
9b30c21f93
Load subcells and default subcell index from mod.yaml
2014-08-04 18:09:26 -05:00
atlimit8
4b7537bb13
Moved MobileInfo.SubCellOffsets to Map (dropping static) & added Map.SubCellsDefaultIndex
2014-08-04 18:09:26 -05:00
atlimit8
43478dd500
enum SubCell => int & Dictionary<SubCell, WVec> => WVec[]
2014-08-04 18:09:26 -05:00
Taryn Hill
d6931f1d05
Added flag to Mobile/AircraftInfo: MoveIntoShroud.
...
Does not change the audio feedback given.
2014-08-01 20:43:29 -05:00
Paul Chote
ce99f02ba6
Merge pull request #5678 from pavlos256/find-tiles-in-circle
...
Fix and optimize FindTilesInCircle
2014-07-04 10:27:37 +12:00
Pavlos Touboulidis
daed053a57
Fix and optimize FindTilesInCircle
2014-07-03 18:11:28 +03:00
Paul Chote
a30c8b53a7
Add support for diamond cell grids.
2014-06-30 23:44:23 +12:00
Paul Chote
d7f1b1c9e2
Remove CVec -> WVec conversion.
2014-06-27 23:30:41 +12:00
Paul Chote
9487f49cd5
Replace WPos.ToCPos -> Map.CellContaining.
2014-06-27 23:30:40 +12:00
Paul Chote
7b52fa52b6
Replace CPos.CenterPosition -> Map.CenterOfCell.
2014-06-27 23:30:40 +12:00
Paul Chote
b6d1d26eeb
Add World parameter to Util.BetweenCells.
2014-06-27 23:30:40 +12:00
Paul Chote
086ec07eb6
Add World parameter to Target.FromCell.
2014-06-27 23:30:40 +12:00
Paul Chote
78f8c94df8
Make PathDistance struct immutable.
2014-06-27 22:07:03 +12:00
Paul Chote
5560f276ca
Map: Rename IsInMap -> Contains.
2014-06-27 22:07:03 +12:00
Paul Chote
441971f6d7
Use CellLayer for pathfinding.
2014-06-27 22:07:03 +12:00
Paul Chote
97a61273dd
Bring PathSearch in line with the current code style.
2014-06-27 19:20:46 +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
Paul Chote
f6f366c4b3
Merge pull request #5401 from RoosterDragon/nodesdict
...
Changed MiniYaml.NodesDict property into a method.
2014-06-12 17:34:59 +12:00
RoosterDragon
a598a01108
Fixed IDisposable implementation and usage.
...
- Implement IDisposable interface correctly, with sealed classes where possible for simplicity.
- Add using statement around undisposed local variables.
2014-06-10 11:23:55 +01: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
Chris Forbes
5eb61dbdd2
Merge pull request #5411 from RoosterDragon/general-clean
...
General Cleanup
2014-05-25 11:03:03 +12:00