-
Notifications
You must be signed in to change notification settings - Fork 64
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
Anything against making MapLayer::Chunk public? #156
Comments
I have to admit I haven't used this in a while so I've kind of forgotten how it works 😅 Just had a quick look at the source though - it seems |
Thanks for the reply.
There the Chunk is private and final inside a MapLayer declared final as well. I would like to know the rationale for the final keyword and would ask if I can remove it and make chunk public in a PR to help me with keeping my project better synchronized with upstream. This should not impact any project negatively. |
Oh! I apologise 😅 The SFML example is meant as just that - an example. It's mostly written by contributors now too. If you have something that you feel is useful and improves upon it (without breaking existing features) then any changes are welcome! 😁 Thanks |
I am working now for some time with this library, but recently I stumbled over a small detail which blocks my progress :
I am using properties on tiles and objects to mark in my level certain elements like keys, switches, switchable doors, enemies, etc. usually I add properties to these objects to customize the behavior.
I also want to use this principle for moving platforms and other decorations:
![image](https://private-user-images.githubusercontent.com/13638691/327906376-09220f14-3bb8-42e0-ba97-3b039c6e7d23.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUwMzU2MTQsIm5iZiI6MTcyNTAzNTMxNCwicGF0aCI6Ii8xMzYzODY5MS8zMjc5MDYzNzYtMDkyMjBmMTQtM2JiOC00MmUwLWJhOTctM2IwMzljNmU3ZDIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMwVDE2MjgzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc5MWE2Y2ZmNDRjMDc1MjkyNmEwMjEwYTQ2MTMyMDFjMjJjYTc0NmNmMGQ2YjQ4OGE5MTgyZTJjNTU5NWZkNWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.EHDfkRt9M4K5Obb_IJ-mLbjlmo4GJSoBHdw_I6XFro0)
For example:
Here you see such a platform ("moving_platform") and its parameters(it will swing 40px up an down again). The advantage is that you can easily paint your level and even draw the paths of moving platforms and enemies inside the level editor.
But the problem is, that the code for rendering a part of the map is implemented in the Chunk class which is private to MapLayer.
From an Software architecture pov I would like to manage the moving platforms outside of the MapLayer, but then I cannot instantiate a Chunk. I cannot derive MapLayer nor Chunk as both are declared final(<--why?). Only possibility I see is to duplicate the code. But we are not using C++ to start to copy+paste methods into new classes, do we?
Would it be fine to make chunk public or the classes not final?
Or is there something else I miss?
The text was updated successfully, but these errors were encountered: