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

organize under single health package #71

Closed
keturn opened this issue Mar 9, 2021 · 4 comments · Fixed by #78
Closed

organize under single health package #71

keturn opened this issue Mar 9, 2021 · 4 comments · Fixed by #78

Comments

@keturn
Copy link
Contributor

keturn commented Mar 9, 2021

The package names currently used in this module make it difficult to distinguish which classes are in this module and which are from engine or elsewhere.

Recommend all packages here descend from a single org.terasology.health (or org.terasology.module.health?) instead of org.terasology.logic & rendering.

@skaldarnar
Copy link
Contributor

Totally agree! While we're at it, can we sort and organize the events and components in this module as well? 🙃

I think putting modules into a dedicated org.terasology.module namespace is a good idea to avoid surprising name clashes. although this should already be less likely if the engine has it's dedicated namespace...

@skaldarnar
Copy link
Contributor

Following the same pattern as proposed in Terasology/Inventory#37 I suggest the following structure:

org.terasology.module.health
├── components
│   ├── BlockDamagedComponent.java
│   ├── DamageResistComponent.java
│   ├── DamageSoundComponent.java
│   ├── HealthComponent.java
│   └── RegenComponent.java
├── events
│   ├── ActivateRegenEvent.java
│   ├── BeforeDamagedEvent.java
│   ├── BeforeRestoreEvent.java
│   ├── ChangeMaxHealthEvent.java
│   ├── DeactivateRegenEvent.java
│   ├── DoDamageEvent.java
│   ├── DoRestoreEvent.java
│   ├── HealthChangedEvent.java
│   ├── MaxHealthChangedEvent.java
│   ├── OnDamagedEvent.java
│   ├── OnFullyHealedEvent.java
│   ├── OnRestoredEvent.java
│   └── RestoreFullHealthEvent.java
├── systems
│   ├── BlockDamageAuthoritySystem.java
│   ├── DamageAuthoritySystem.java
│   ├── HealthAuthoritySystem.java
│   ├── HealthClientSystem.java
│   ├── RegenAuthoritySystem.java
│   └── RestorationAuthoritySystem.java
└── ui
    ├── BlockDamageRenderer.java
    ├── DirectionalDamageOverlay.java
    ├── HealthHud.java
    └── TimingInformation.java

@keturn
Copy link
Contributor Author

keturn commented Mar 12, 2021

this is really opening the can of worms, but do you want to change any of those class names while we're at it?

the thing that made me ask is looking at those events and seeing things like

  • some events use prefixes like Do and On, others don't
  • FullyHealed / RestoreFullHealth?

@skaldarnar
Copy link
Contributor

do you want to change any of those class names while we're at it?

Yes, I do 💍 😅

skaldarnar added a commit that referenced this issue Apr 17, 2021
Organizes everything in this module under the namespace `org.terasology.module.health`. Sub-packages are used to organize the elements of the ECS, namely:

- components
- systems
- events
- ui

BREAKING CHANGE: moving and renaming packages is incompatible for all modules depending on Health.
Resolves #71
skaldarnar added a commit that referenced this issue Apr 17, 2021
Organizes everything in this module under the namespace `org.terasology.module.health`. Sub-packages are used to organize the elements of the ECS, namely:

- components
- systems
- events
- ui

BREAKING CHANGE: moving and renaming packages is incompatible for all modules depending on Health.
Resolves #71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants