Skip to content

Refactor entity IO, storage and handling#548

Merged
lahm86 merged 24 commits intoLostArtefacts:masterfrom
lahm86:issue-507-entities
Sep 22, 2023
Merged

Refactor entity IO, storage and handling#548
lahm86 merged 24 commits intoLostArtefacts:masterfrom
lahm86:issue-507-entities

Conversation

@lahm86
Copy link
Copy Markdown
Collaborator

@lahm86 lahm86 commented Sep 22, 2023

Following on from #547, this is quite a big cleanup for entity IO, storage and handling across all levels. Similar to before, this is generally broken down per commit.

  • Renamed TR1 TREntity to TR1Entity.
  • Created TR3Entity and TR5Entity to separate out from TR2/4 for these games.
  • Created a common TREntity class with generic TypeID.
  • Converted types on entities from shorts to TR1Type, TR2Type etc; removed unnecessary casting throughout.
  • Converted entity arrays to lists in level classes and removed NumEntities.
  • Removed lots of now unnecessary statements such as converting an entity array to a list, adding to it, converting it back to an array and increasing NumEntities on the level.
  • Removed logic duplication in environment functions that manipulate entities.
  • TRGE updated to match entity changes.

I've also simplified the logic for testing for enemy item drops to use LINQ and removed lots of duplication. And chicken behaviour conditions are also slightly more simplified, or at least more readable.

Part of #507 and part of #468.

@lahm86 lahm86 added this to the 1.8.0 milestone Sep 22, 2023
@lahm86 lahm86 self-assigned this Sep 22, 2023
@lahm86 lahm86 merged commit dcacd28 into LostArtefacts:master Sep 22, 2023
@lahm86 lahm86 deleted the issue-507-entities branch September 22, 2023 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants