Campbell Ritchie wrote:Welcome to the Ranch
We haven't worked out the “spam” problem, yet, but are still trying.
If you have a nested class with a static getPopulation() method, there is something iffy about that design. Why is MaleWC a nested class in the first place? Why is its population static?
Thanks for trying to help with Spam issue. Not a big deal, feel this is a bit of a lost cause.
MaleWC is a nested class (assuming the nested class bit is referring to creating it in the proto and then using it in the class, my syntax is bad) because there are several services that interact with several rooms and the original idea was that if population changed in one service it would be reflected in another. The dreams of mice and men. The goal has been massively scaled back due to how lost I am but that was the original intent. My first attempt was creating Room as it's own proto but I couldn't compile it so I settled with putting it in the most relevant proto.
MaleWC is static because if static is not added to I get the following error on the if clause and on other lines like the following
Cannot make a static reference to the non-static method MaleWC() from the type CapacityService
As for why the original class Room is the way it is, it's a generated class and I can't tell. It has this warning on top and I've been adhering to it
// Generated by the protocol buffer compiler. DO NOT EDIT!