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

move overlay files to their own folders #266

Open
Tracked by #220
red031000 opened this issue Nov 11, 2023 · 5 comments
Open
Tracked by #220

move overlay files to their own folders #266

red031000 opened this issue Nov 11, 2023 · 5 comments

Comments

@red031000
Copy link
Member

lucky made me do this

all files that belong to overlays should be within their own folders, preferably those folders being inside an overlay folder

preferably the format should be

src/overlay/battle/{src,include}/file.c

this can be debated

@lhearachel
Copy link
Contributor

I don't like breaking the paradigm of the top-level folder split being src/include; embedding that deeper seems like a breach of C norms that isn't really worth it and is potentially just confusing.

I think the overlay subfolder is also unnecessary.

How will this work for linked overlays? e.g., the battle code is split across multiple different overlays.

@red031000
Copy link
Member Author

ideally it would be so that each overlay has its own folder, so it might need to get specific for stuff like battle

@lhearachel
Copy link
Contributor

lhearachel commented Nov 11, 2023

I don't mind the idea of, e.g., src/(overlay/){battle_eng,battle_ui,battle_ai} (overlay subfolder optionally omitted, depending on how the full structure looks).

@luckytyphlosion
Copy link
Member

Issue name shouldn't be an implementation task when consensus hasn't been decided.

@lhearachel
Copy link
Contributor

lhearachel commented Mar 1, 2024

I would like to propose the following structure, using a few example overlays for illustration. For brevity, only include is shown here, but src would follow the same structure.

project
│   README.md
│   ...
│
└───files
│   ...
│
└───include
    │   global.h
    │   main.h
    │   ...
    │
    └───berry_pots_app
    │   │   berry_pots_app.h
    │   └───berry_pots_app_internal.h
    │
    └───battle
        │   battle.h
        │   battle_system.h
        │   battle_controller_player.h
        │   ...
        │   
        └───trainer_ai
        │   └───trainer_ai.h
        │   
        └───link_battle
            └───link_battle.h

This structure clarifies in the directory hierarchy that some overlays are coupled to others, and thus a child overlay (e.g., trainer_ai) requires a parent overlay to also be loaded (e.g., battle) in order to be functional. Additionally, due to the hierarchical nature, we can select names that avoid overall namespace pollution while still keeping related overlays close to one another; if we went with a flatter directory structure of one folder to one overlay, we would need to employ some sort of prefixing system to achieve that (e.g., battle_trainer_ai).

The downside to this is that nested directories can get messy to fully integrate with a build system. But I think the trade-off of effort investment to usability is worthwhile.

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

No branches or pull requests

3 participants