Commit Graph
88 Commits
Author SHA1 Message Date
f2625bf5c5 Removes IMapManager (#6584)
* Move MapManager queries to SharedMapSystem
Moves all variants of FindGridsIntersecting/TryFindGridAt to SharedMapSystem
Hollows out the MapManager methods and converts them into relays to SharedMapSystem

* Move CreateGrid to SharedMapSystem
Moves the functionality for CreateGrid and its variants to SharedMapSystem
Hollows out the MapManager methods and converts them into relays for the SharedMapSystem methods
Obsoletes them too
Also moves over the GetAllMapGrids and GetAllGrids methods

* Move RaiseOnTileChanged to SharedMapSystem
Also moves the SuppressOnTileChanged flag member to SharedMapSystem
Hollows out and obsoletes the MapManager versions

* Move default value constants to SharedMapSystem

* Converts map pausing events into LocalizedEntityCommands

* Move MapManager related delegates/structs to SharedMapSystem
Moves the GridCreationOptions struct to the same namespace as SharedMapSystem and converts it into a record struct
Move the GridCallback delegates to the same namespace as SharedMapSystem

* Move CullDeletionHistory to SharedMapSystem
Well, that was less painful than I thought it would be

* Actually obsolete the NetworkedMapManager method

* Rename file

* Doc comments for new SharedMapSystem methods

* Doc comment

* Doc comments

* Fix access

* Purge all references to IMapManagerInternal

* Cull easy IMapManager references

* The rest

* Purge IMapManager

* Private internal FindGridsIntersecting method

* please die

* 41

* notes

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
2026-07-01 19:32:17 -07:00
83c2a1be11 [Dependency] source generator part 2 (#6550)
* [Dependency] source generator

No more reflection, no more codegen at runtime

Also various changes to Roslyn helpers to make this easier to write.

Requires all types with dependencies to be partial and not have readonly dependency fields. An analyzer enforces this at warning level, the previous injection strategies have remained in the code *for now* as a fallback.

No fallback is available for [field: Dependency] properties, due to a Roslyn bug.

Code Fixes exist. We love Roslyn

* Apply dependencies generator changes to all code

* Release notes

* Preprocessor got hands

* Handle nullable dependencies

These are bad but gotta deal with it.

* Apply suggestions from code review

Co-authored-by: Moony <moony@hellomouse.net>

* Fine, let's not use collection expressions

---------

Co-authored-by: Moony <moony@hellomouse.net>
2026-05-08 12:38:33 +02:00
metalgearslothandGitHub 01979c451d Make RaiseMoveEvent internal (#5918)
I don't think content should really be calling this tbh.
2025-05-27 19:45:04 +10:00
TayrtahnandGitHub 3d8a9a41fa Combine TileChangedEvents in SetTiles (#5912)
* Combine TileChangedEvents in SetTiles

* Raise event after regenerating collision

* continue, not return

* No need for GetComponent

* Swap TileRef for Tile + Vector2i

* Estimate size of tileChanges
2025-05-15 20:22:05 +10:00
metalgearslothandGitHub 6086076559 Avoid checking grid traversal for rotation events (#5778)
* Avoid checking grid traversal for rotation events

* Also this one
2025-05-10 22:01:43 +10:00
metalgearslothandGitHub 04406311dc Use EntityQuery for map / grid calls (#5869)
Avoids the type lookup etc etc.
2025-04-20 12:59:06 +10:00
Kyle TyoandGitHub ee45a608b9 Replace IsMap and IsGrid calls with HasComp (#5866) 2025-04-20 12:21:19 +10:00
fbc706f37b Refactor map loading & saving (#5572)
* Refactor map loading & saving

* test fixes

* ISerializationManager tweaks

* Fix component composition

* Try fix entity deserialization component composition

* comments

* CL

* error preinit

* a

* cleanup

* error if version is too new

* Add AlwaysPushSerializationTest

* Add auto-inclusion test

* Better categorization

* Combine test components

* Save -> TrySave

Also better handling for saving multiple entities individually

* Create new partial class for map loading

* Add OrphanSerializationTest

* Include MapIds in BeforeSerializationEvent

* Addd LifetimeSerializationTest

* Add TestMixedLifetimeSerialization

* Add CategorizationTest

* explicitly serialize list of nullspace entities

* Add backwards compatibility test

* Version comments

also fixes wrong v4 format

* add MapMergeTest

* Add NetEntity support

* Optimize EntityDeserializer

Avoid unnecessary component deserialization

* fix assert & other bugs

* fucking containers strike again

* Fix deletion of pre-init entities

* fix release note merge conflict

* Update Robust.Shared/Map/MapManager.GridCollection.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* VV

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2025-02-16 21:25:07 +11:00
51edceae4d Ensure parents are always initialized & started before children (#5595)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2025-01-29 23:16:14 +11:00
metalgearslothandGitHub 82c94fc8b0 transform traversals (#5564) 2024-12-21 15:49:43 +11:00
Pieter-Jan BriersandGitHub 05cdb99252 Warning fixes around IMapManager.GetMapEntityId (#5298)
* Add MapSystem.GetMapOrInvalid

This is effectively the same exact behavior as IMapManager.GetMapEntityId. Adding this so I don't have to consider whether warning fixes using MapSystem.GetMap() instead would change behavior.

* Warning fixes around IMapManager.GetMapEntityId

* Fix tests
2024-07-13 15:27:32 +10:00
eoineoineoinandGitHub 56c30edf04 Replace Matrix3 with System.Numerics.Matrix3x2 (#5078)
* Delete Matrix3. Replace with System.Numerics.Matrix3x2

* Feedback

* release notes
2024-06-02 14:08:47 +10:00
metalgearslothandGitHub dd56de70b7 Fix grid-based audio (#5087)
* Fix grid-based audio

- Fixes parenting issues.
- Add SetGridAudio as an easy way to set it up and apply the override too.

* No more global

* Rejig it all

* mergew

* review

* Minor optimisation

* Revert "Minor optimisation"

This reverts commit d0cdac7690.
2024-05-29 16:14:37 +10:00
Leon FriedrichandGitHub 25211e3781 Improve transform & state handling exception tolerance (#5081)
* Improve transform & state exception tolerance

* release notes

* Fix pvs assert

* Fix velocity conservation
2024-04-29 18:42:05 +10:00
Leon FriedrichandGitHub d5c4981648 Partial MapManager refactor (#5042)
* MapManager rejig

* Update Tests

* A
2024-04-18 14:05:02 +10:00
TayrtahnandGitHub 9bfe889c86 Code cleanup: Purge obsolete MapManager methods (#4981)
* GetGrid

* GridExists

* TryGetGrid
2024-03-21 16:31:33 +01:00
metalgearslothandGitHub 19c48862e2 Entitylookup tweaks (#4808)
* Entitylookup tweaks

- Removed a dupe internal method.
- Removed some dupe internal code.
- Renamed some methods in line with local vs non-local.

* Update release

* Also this
2024-01-14 19:10:33 +11:00
metalgearslothandGitHub 270326e188 Add IComponentState / struct support (#4610)
Still boxes but hey at least the struct dream is real.
2024-01-04 13:42:47 +11:00
Leon FriedrichandGitHub f4faa1ad3d Run grid traversal on entity spawn (#4796)
* Run grid traversal on entity spawn

* Add test

* Fix tests
2024-01-02 17:25:13 +11:00
KaraandGitHub d416344aef MoveEvent broadcast -> C# event (#4732)
* MoveEvent broadcast -> C# event

* Broadcast MoveEvent -> C# event

* oops

* forgob

* release notes

* Update description of moveevent
2023-12-19 12:26:13 +11:00
metalgearslothandGitHub 9a1e6af586 Remove DeferMoveEvent (#4709) 2023-12-14 17:20:02 +11:00
Leon FriedrichandGitHub 2cd2d1edd6 Add misc helpful methods (#4577) 2023-11-19 15:05:26 +11:00
Leon FriedrichandGitHub 773b87672b Fix terminating entity reparenting bug (#4549) 2023-11-08 15:39:08 +11:00
Leon FriedrichandGitHub 9e5c1e9c95 Change place-next-to helper methods (#4506) 2023-10-22 16:52:58 +11:00
Leon FriedrichandGitHub f3af813b57 Transform interpolation fixes (#4488) 2023-10-17 23:47:45 +11:00
metalgearslothandGitHub 3fd731d917 Network entity ids (#4252) 2023-09-11 09:42:55 +10:00
Leon FriedrichandGitHub 1c64fa1f28 Fix TransformSystem.SetCoordinates() error logs. (#4245) 2023-08-07 11:24:26 +10:00
metalgearslothandGitHub e4a14d1ec8 Start MapGrid ECS (#4185) 2023-07-23 20:50:23 +10:00
metalgearslothandGitHub 7d1ad527d9 Replace Robust Vector2 with System.Numerics (#4092) 2023-07-08 14:08:26 +10:00
Leon FriedrichandGitHub f6a5e0ed93 Fix doc comments & typos (#4170) 2023-07-06 15:28:09 +10:00
metalgearslothandGitHub e763d59617 Remove some unnecessary EntityQuery<T> and warns (#4167) 2023-07-02 01:12:45 +10:00
metalgearslothandGitHub b82d246988 Fix ComponentTreeSystem warnings (#4164) 2023-07-01 19:23:37 +10:00
Leon FriedrichandGitHub b422d8d3ca Make map-grids set TransformComponent.GridUid (#4040) 2023-05-15 12:39:45 +10:00
Leon FriedrichandGitHub 4242591b56 Fix pvs chunk update bug (#3961) 2023-04-23 16:23:24 +10:00
Leon FriedrichandGitHub e56501649b Fix rounding in GetGridOrMapTilePosition() (#3813) 2023-03-03 00:21:32 +11:00
Pieter-Jan BriersandGitHub 6bdb7c040f Fix some warnings. (#3803) 2023-02-25 11:20:29 +11:00
metalgearslothandGitHub 211dfb4b11 Cull some .Owner calls around transforms (#3791) 2023-02-22 12:40:29 +11:00
metalgearslothandGitHub d9c0c84efa Deprecate TileChangedEventArgs (#3670) 2023-01-09 13:39:45 +11:00
metalgearslothandGitHub 5e3a5a0d0c Merge MapGrid into MapGridComponent (#3468) 2022-11-22 13:04:51 +11:00
metalgearslothandGitHub 4521dc37f5 Remove IMap / IMapGrid comps (#3434) 2022-11-04 10:12:36 +11:00
metalgearslothandGitHub 828ac48f7c Remove transform methods from MapGrid (#3382) 2022-11-01 11:27:41 +11:00
Leon FriedrichandGitHub b637967163 Remove some duplicate code in DetachParentToNull() (#3417) 2022-11-01 00:53:23 +11:00
Leon FriedrichandGitHub b5662007d5 Fix GetEntitiesIntersecting bug (#3420) 2022-10-31 21:22:41 +11:00
Leon FriedrichandGitHub 1e843bf3a2 More Transform ECS (#3368) 2022-10-30 03:36:23 +11:00
Leon FriedrichandGitHub 601feb7cc0 Optimize DeparentAllEntsOnTile (#3401) 2022-10-29 14:26:04 +11:00
ae2f3fe70c Remove EntityLookupComponent and de-dupe AABBs (#3367)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-27 23:36:01 +11:00
Leon FriedrichandGitHub e3d29ae28f Change PVS parent-change handing (#3362) 2022-10-25 23:44:35 +11:00
Leon FriedrichandGitHub 6943693d3f Add trace to mid-deletion reparenting error logs. (#3356) 2022-10-21 15:39:34 +11:00
a76d053818 Prevent PVS error spam and add more debugging asserts (#3263)
Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
2022-09-21 09:49:14 +10:00
Pieter-Jan Briers 1c28782d5d Fix some grid-related warnings 2022-07-21 17:35:09 +02:00