Tag Info

New answers tagged

1

Should, for example, each tile store the data of its reward or there should be a reward manager for checking how many tiles are consecutive next to each other to give the reward to the player? How I would do it You have a Reel object that can be spun randomly You have a number of Reward objects that have a threshold required to win, and a prize amount ...


2

In general, when you are doing object oriented programming, you want your data and behavior to be together (in one class). You also want to achieve high cohesion with your classes. This means that most/all of your methods use most/all of the attributes in your class. This will help you achieve the single responsibility principle. Low cohesion means that ...


1

Classes are often used for concepts, to hold together all the attributes of the concept and the interactions that are possible. When deciding what to do however, it's purely a matter of what works best, and what design is the best. When you are deciding what to do I'd go about it this way: If the calculation is part of the (to be) object, make a class for ...



Top 50 recent answers are included