(static) variables like minimum_reliability = 80 and in which file should I store them. I'm thinking of creating a section with
all my variables in the same place so I can easily tweak my AI without having to look for in which .nut file they're used.
local variable
Code: Select all
class One
{
minimum_reliability = 80;
constructor()
}
function a(b)
{
return b+minimum_reliability; //or this.minimum_reliability
}
Code: Select all
class InMainNut
{
_minimum_reliability = 80; //prefixed with _ as globals should be according to guideline
}
class One
{
constructor()
}
function a(b)
{
return b+::_minimum_reliability;
}
So, to sum up. Could I just move all my values like minimum_population_for_road_access, maximum_loan and the like to my main.nut file? I'm not sure if that will constitute good coding though. How do you guys keep track of those values?