I have working classes, each has a method that increases the count. a specific resource. In the Resources class there are closed static static fields denoting count. each resource, as well as getters, setters.

How to make an increase in the resource work?

To do in the class of the working instance Resources , from the instance to get and increase the amount of the resource, or not to make the instance and access through the open methods Resources.getWoodAmount() and Resources.setWoodAmount() ?

  • why not to make inside the Resources method with a visa which will increase the desired value - Bohdan Korinnyi
  • The question is not very clear, and the context is unclear. It can be done in many different ways, but to give a meaningful answer, the situation must be understood better than it can be understood from your question. In particular, does the resource belong to the entire class of workers, or do they have copies of the workers, and each of them has its own quantity of the resource? - m. vokhm

0