[Suggestion] Unit type case conversion/consistency

Started by GoodMorning, January 05, 2017, 09:05:56 PM

Previous topic - Next topic

GoodMorning

Currently we have "LandEnergyPod" and "PRPLCORE". Could the case become consistent?

Also, could CreateUnit become case-insensitive?
A narrative is a lightly-marked path to another reality.

knucracker

You can also use "CommonUnit" instead of "PRPLCORE".  Everything else uses camel case.  The code looks at exact string matches currently and I'd rather not change it.  There's a really good chance I'd miss something somewhere and it would create a bug that would be hard to find in the future.

Karsten75

Quote from: virgilw on January 06, 2017, 12:48:14 PM
You can also use "CommonUnit" instead of "PRPLCORE".  Everything else uses camel case.  The code looks at exact string matches currently and I'd rather not change it.  There's a really good chance I'd miss something somewhere and it would create a bug that would be hard to find in the future.

You *could* double up on the case statements for those Unit types that are inconsistent... :)

That would be compatible, but provide another layer of inconsistency where some units can be recognized as PRPLCORE and PRPLCore (or is that PrplCore?) ...

Sorrontis

We do need a list of the unit types... but maybe it's there already and I'm blind  8)
"If you want others to be happy, practice compassion. If you want to be happy, practice compassion."

Stickman

Quote from: Sorrontis on January 06, 2017, 05:36:22 PM
We do need a list of the unit types... but maybe it's there already and I'm blind  8)

Wiki Link - is that what you seek?
=====> This is a moderately pointy stick. You need to poke me with it once in three days if you need PRPL from me

Sorrontis

Quote from: Stickman on January 06, 2017, 05:38:36 PM
Quote from: Sorrontis on January 06, 2017, 05:36:22 PM
We do need a list of the unit types... but maybe it's there already and I'm blind  8)

Wiki Link - is that what you seek?

Apparently I'm very blind.... very very blind.
"If you want others to be happy, practice compassion. If you want to be happy, practice compassion."

GoodMorning

I was thinking of wrapping GetStringFromStack() in String.ToLowerCase() before doing the comparison in CreateUnit. Just a suggestion, and only made because I thought it was approximately a one-line change.
A narrative is a lightly-marked path to another reality.

Sorrontis

Talking about this. Is  there a list of the scriptvariables for each unit? For example, so I can change the damage a ticon gun does over time?
"If you want others to be happy, practice compassion. If you want to be happy, practice compassion."

GoodMorning

Not yet, that will have to wait for V's personal attention, as he is the one with the source code.
A narrative is a lightly-marked path to another reality.