Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify characters into a single repository/provider #186

Open
ethanmoffat opened this issue Apr 27, 2022 · 0 comments
Open

Unify characters into a single repository/provider #186

ethanmoffat opened this issue Apr 27, 2022 · 0 comments

Comments

@ethanmoffat
Copy link
Owner

There isn't really any reason to keep MainCharacter in its own repository. It's convenient, but leads to a lot of code such as

if (id == _characterProvider.MainCharacter.ID)
{
...
}
else if (_currentMapStateProvider.Characters.Contains(id))
{
...
}
else
{
...
}

Which is pretty bloated when the operations are usually the same thing.

Instead, it would be better to store the ID of the main player in the PlayerInfoProvider and put all characters and their renderers in the same collection, without differentiating between "main player" and other logged-in players. Packets that are handled specifically for the main player can use the property in PlayerInfoProvider to find the right character.

@ethanmoffat ethanmoffat added this to the Version 1 milestone Apr 27, 2022
@ethanmoffat ethanmoffat modified the milestones: Version 1, vNext May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant