u/migukau

Game breaking bug in the new arena mode.

They wrote the gamemode as 3x6 when its actually 6x3. How am I supposed to play this?

reddit.com
u/migukau — 10 days ago

Question about oop encapsulation.

Let's say I have these classes:

House

HouseCatalgog- stores houses and other relevant information

SystemState- stores a HouseCatalog and other catalogs. Basically, there is an instance of this class that stores all the data my program uses and needs.

Menu - a menu class where the user can interact.

How should the menu class do something like change the name of a house from user input? Right now, it calls SystemState.changehousename(houseID, name), which then calls HouseCatalog.changehousename(houseID, name), which calls House.changename(name).

But I feel like this is C encapsulation and not correct for Java. My getters for the HouseCatalog class use a clone() so they don't return the actual pointer to houses I have stored.

Am I doing this wrong? Can I return the actual pointer from the house without breaking encapsulation, and then the Menu class just does House.changeName(name)?

reddit.com
u/migukau — 14 days ago

Java oop encapsulation best practices.

Let's say I have these classes:

House

HouseCatalgog- stores houses and other relevant information

SystemState- stores a HouseCatalog and other catalogs. Basically, there is an instance of this class that stores all the data my program uses and needs.

Menu - a menu class where the user can interact.

How should the menu class do something like change the name of a house from user input? Right now, it calls SystemState.changehousename(houseID, name), which then calls HouseCatalog.changehousename(houseID, name), which calls House.changename(name).

But I feel like this is C encapsulation and not correct for Java. My getters for the HouseCatalog class use a clone() so they don't return the actual pointer to houses I have stored.

Am I doing this wrong? Can I return the actual pointer from the house without breaking encapsulation, and then the Menu class just does House.changeName(name)?

reddit.com
u/migukau — 14 days ago