NumberPolarityGetter (is_even) 🔗
How to use 🔗
Please read the code to understand how it is used, as it is self-documenting. However, here is a small guide:
First we must create an instance of the factory factory singleton.
local MyNumberPolarityGetterFactorySingleton = NumberPolarityGetterFactorySingleton.new()
Next, we can instantiate a factory from the singleton.
local MyNumberPolarityGetterFactory = MyNumberPolarityGetterFactorySingleton:make_number_polarity_getter_factory()
Now, we must set up that factory for use. Otherwise there's nothing to create the is_even instances.
MyNumberPolarityGetterFactory:pay_attourney_fees()
MyNumberPolarityGetterFactory:lobby_government_for_harsher_regulations()
MyNumberPolarityGetterFactory:sign_union_contract()
MyNumberPolarityGetterFactory:attend_funeral_of_whistleblower()
-- Unfortunately, this next step is still necessary until the Workers Decide Act of 2029 comes into effect in July.
MyNumberPolarityGetterFactory:pay_staff()
Now we can create an instance of is_even.
local MyNumberPolarityGetter = MyNumberPolarityGetterFactory:make_number_polarity_getter()
Then, simply call is_even with an integer argument. Due to a memory leak, it is advised that each instance of the NumberPolarityGetter is only called a few hundred times before being freed and replaced.
if MyNumberPolarityGetter:is_even(5641) then
-- your code here
end
You can optionally call with a second argument to use the deprecated version of the function. This doesn't have a memory leak and is several hundred times faster, but you still shouldn't use it because it's bad practice.
if MyNumberPolarityGetter:is_even(5641, true) then
-- your code here
end
simplifies modding a bit
I was being uncooperative with unionization efforts manually before, but I've been able to make some small edits to this source to use it as an API, so now I just skip union contract signings automatically.
The code is VERY clean, too, so even if you don't want to make any edits, it is very easy to read through to understand how to make sure is_staff_paid is ture.
Off topic
It's not even a joke mod a player could actually enjoy, and the satire refers to Java-style programming, which is far from Lua, as Lua is multi-paradigm and therefore not so obsessed with "Gang of 4" patterns, so it won't entertain programmers either. I understand the joke, but "we are not amused".
ContentDB is operated by a single person, using their own money, and I find it borderline offensive to use it for useless stuff like this. I think that the moderators were too lenient here.