To Nadeo: How do I split up a plugin into multiple classes?
Posted: 07 Jan 2013, 20:12
I'm trying to split up a fairly large plugin into multiple classes for easier readability and navigation, and I've noticed that the MLEPP core plugin accomplishes this, but newer versions of ManiaLive are incompatible with the extra classes' use of the Connection class. How should I split up my plugin into multiple classes, as below, so that the new classes would be forward-compatible? Do I need the extra classes to inherit anything?
- Plugin class - The main class that contains the framework for the plugin and parses the /server supercommand.
- CoreFunctions class - A class containing basic server functions, like shutting down the server and changing its name.
- Moderation class - A class containing functions regarding server moderation.
- TrackControl class - A class containing functions that control when tracks in the playlist are played.
- TrackList class - A class containing functions that add or remove tracks in the playlist and save the changes.
- Billing class - A class with functions related to charging and paying out Planets.
- Bill class - A class for creating Bill objects containing data associated with pending bills generated from the Billing class.
- PrivateMessage class - A class for the "private message" function.
- ManiaHome class - A class with functions related to posting ManiaHome notifications.