Commit Graph

11 Commits

Author SHA1 Message Date
RoosterDragon
8a60880cf1 Tackle the last of the low hanging fruit for memory allocations in the main game loop.
- Avoid calling string.Split twice in SprintFont.Measure.
- Change ActorsInBox method of ActorMap and ScreenMap to avoid allocating and intermediate list. As a bonus this allows the sequence to be lazily consumed. Also avoid LINQ in these methods.
- In FrozenUnderFog.TickRender, the method exits early if no players are visible so the attempt at lazy generation was not needed.
- Unwrap a LINQ Any call in ClassicProductionQueue.Tick.
- Merge some successive Where calls in ProximityCapturable into single predicates.
2014-06-22 17:29:45 +01:00
ScottNZ
dbffce81a6 Remove unused usings 2014-06-15 22:16:40 +12:00
RoosterDragon
b8b8b1e2df Minor changes to reduce allocation.
- Cache a predicate in ActorMap.
- Use short circuiting to skip a call to HasTrait in AttackBase.
- In AutoTarget.ScanForTarget, move the check for the scan time above the calculations since we can skip them if it's not time yet.
- In AutoTarget.ChooseTarget, merge four Where calls into one.
2014-06-12 05:32:44 +01:00
RoosterDragon
2bd8778c55 Changed removeActorPosition field in ActorMap into a set.
This is because it's purpose is to be queried via Contains when actors needed to be removed.
2014-05-23 08:30:45 +01:00
ScottNZ
00ec1ca87a Remove unused usings 2013-11-12 19:39:33 +13:00
Paul Chote
4f354e1474 Batch ActorMap add/removes and filter invalid ActorsInBox. Fixes #3897. 2013-10-05 13:19:47 +13:00
Paul Chote
85f854ccde Clean up ActorMap. 2013-10-05 12:59:54 +13:00
Paul Chote
3f8d75a1ac Remove SpatialBins. 2013-09-27 15:36:51 +12: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
4a2a747556 Pull ActorMap back out into a trait. 2013-09-27 15:36:49 +12:00