Hi, I am using the OOP Library "classic", I created a single "item" class as a base class for many more classes like "cabinet", "crib, "toys", etc.
I was wondering if I can just use a single file that will contain all of the children class. It seems inconvenient if i will create a file for each class.
Single File for Multiple Class?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- yetneverdone
- Party member
- Posts: 448
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Single File for Multiple Class?
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Re: Single File for Multiple Class?
Its a question of your personal style. For löve it really doesnt matter, it becomes zipped to a single .love file anyway.yetneverdone wrote:Hi, I am using the OOP Library "classic", I created a single "item" class as a base class for many more classes like "cabinet", "crib, "toys", etc.
I was wondering if I can just use a single file that will contain all of the children class. It seems inconvenient if i will create a file for each class.
But sometimes it is usefull to glue all sources into a single .lua file. In this case i do a package preloading in my main lua source file like:
Code: Select all
package.preload["classic"] = function(...)
-- module source here.
..
end;
- Sheepolution
- Party member
- Posts: 264
- Joined: Mon Mar 04, 2013 9:31 am
- Location: The Netherlands
- Contact:
Re: Single File for Multiple Class?
I recommend making a file for each class, no matter how small. This way your code looks a lot more organized and you can navigate your classes easier.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests