Page 2 of 2
Re: Blacklist target category
Posted: 02 Apr 2015, 06:57
by Forboding Angel
Arugh, are you so oblivious?
This would mean that you would have to keep a master list of all categories used in _post and if you did not keep this list up to date, bad (or interesting, depending on your point of view) things would happen. It's kludgy and messy. Moreover it is not consistent with the whitelist behavior, and as a result is quite ugly.
Re: Blacklist target category
Posted: 02 Apr 2015, 10:43
by FLOZi
No you wouldn't.
Re: Blacklist target category
Posted: 02 Apr 2015, 15:27
by hokomoko
FLOZi wrote:No you wouldn't.
You can construct the category list in a quick pass over all units. No need to write it explicitly.
Code: Select all
categories = {}
for _, unitDef in pairs(UnitDefs) do
categories[unitDef.category] = true
Re: Blacklist target category
Posted: 02 Apr 2015, 16:32
by Google_Frog
Forboding Angel wrote:Google_Frog wrote:Forboding Angel wrote:Just because something can be done in lua doesn't mean it should be. Knorke's workaround is a kludgy hack and is extremely inflexible at best.
A blacklist should have been the default in the engine, not a whitelist, but realistically, there should be both a blacklist and a whitelist.
Correct, not everything should be done in lua. But now look at this case. Implementing this in _posts (or somewhere similar):
- Has no performance impact.
- Adds some code complexity but saves the engine internals from that complexity (which is better imo because the engine seems more fragile to me).
- Allows you to quickly change your mind and use different types of lists.
So the benefits of lua (saving the engine from complexity, implementation flexibility) are there without the common drawbacks (performance).
You're still advocating a blacklist derived from a whitelist. Honestly am I the only one who sees the issues with that and the added needless complexity?
Yes.
Re: Blacklist target category
Posted: 02 Apr 2015, 18:58
by PicassoCT
Yes.
But you are free to fork the engine. and push and pull
https://github.com/spring/spring
It seems you used up all your knorkes for today. You must construct additional knorkes.

Re: Blacklist target category
Posted: 02 Apr 2015, 19:08
by Silentwings
To me also the suggested unitdefs/_post implementation seems natural. Although it is a bit annoying only having 32 categories.
If it was possible to both blacklist and whitelist in the unitdef, then since a single unitdef belongs to multiple categories, it doesn't look fun to try and decide the "expected behavior" or suitable error msg for cases which did both at the same time in a logically inconsistent way.
Re: Blacklist target category
Posted: 02 Apr 2015, 22:49
by Forboding Angel
hokomoko wrote:FLOZi wrote:No you wouldn't.
You can construct the category list in a quick pass over all units. No need to write it explicitly.
Code: Select all
categories = {}
for _, unitDef in pairs(UnitDefs) do
categories[unitDef.category] = true
Ok, that's all fine and good, but in the end, you are using a whitelist to create a blacklist and in turn output a whitelist.

Re: Blacklist target category
Posted: 02 Apr 2015, 23:07
by hokomoko
Ok, that's all fine and good
I'm glad we agree.
Re: Blacklist target category
Posted: 02 Apr 2015, 23:13
by Jools
How about we agree to call it greylist and move on to wish each other a happy easter?