answersLogoWhite

0


Best Answer

That would depend on what type of game you are developing. Unlike a concrete class which can be instantiated in its own right, an abstract class can only be instantiated through derivation. In other words, an abstract class can only be used as a base class, and is known as an abstract base class for that reason. We can also refer to them as abstract data type, given a class is also a type.

We typically use an abstract base class to define a common interface for all its derivatives. If we need to divide the interface to cater for specialisations, we can derive intermediate base classes from the abstract base class. In this way we do not pollute the common base class with uncommon virtual methods.

Abstract base classes typically have no data members and thus incur no memory overhead. However, if data members are required, they should be kept to a minimum and should only be declared if essential to the derivatives. Data members that are essential to some but not all derivatives should be placed in the appropriate intermediate class instead.

In a game (or indeed any program) we might have many objects of many different types. However, objects that have a common public base class (including abstract base classes) can be treated as being "of the same type" (the common base). For instance, we might define an abstract Object base class such that all classes that publicly derive from the Object class can be treated as being of the same type (an Object).

In a game we typically have objects that cannot be moved (static objects) and objects that can be moved (non-static). We can separate the two types of object by deriving Static and Nonstatic abstract base classes from our common Object class. We can then derive further intermediate classes from these two classes to cater for all the different types of object in our game. For instance, an armoury usually provides a choice of weapon and allows the user to select a primary and secondary weapon, thus we can derive a common Weaponabstract base class from our Nonstatic abstract base class, and then derive concrete (specific) weapons from the Weaponclass.

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What kinds of game-related classes would be best implemented as abstract?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the kinds of decorative design?

naturalistic conventional geometrical abstract


What are the classes and kinds of credit?

it is me im beautiful


What are the three kinds of noun?

Three kinds of nouns are: singular or plural common or proper concrete or abstract


How many different kinds of classes are there out of school?

50000


What are all kinds of abstract nouns?

Some examples of abstract nouns:abhorrenceabilityaffectionaltruismangerannoyanceantipathyardorattachmentaversionbenevolenceblissbraverycarecharitycheerfulnesscontemptcouragedepressiondesiredesperationdestinationdiscorddisgustdislikedistasteduplicityecstasyeducationeffortelationemotionenjoymentenmityenthusiasmeuphoriaexertionexhilarationexuberancefaith,feelingfelicityfondnessforcefortune,friendshipfunfurygladnessgleegoodwillgreedhappinesshatredhope,inclinationintimacyireirritationjoyjubilationkindnesslifeloathinglonelinesslovelucklustmiserynecessityneed,opinionopportunityoptimismoutragepassionpessimismpleasurepowerpredilectionrageraptureregardreligion,revulsionsadnesssolicitudestrengthsympathytemperthrillvalor,vehemencevexationwantwantonnessweaknessworshipwrathzeal


What type of people live in CA?

Races of all kinds including low classes and high classes.


Different kinds of reasoning in Geometry?

kinds of reasoning1. intuition reasoning2. analogy3. inductive reasoning4. deductive reasoning5. abstract reaoning


What kinds of training should be offered to employees when a new information system is being implemented?

The employees should be retrained on how to use the new system when a new information system is being implemented.


Is evolution an abstract word?

No, evolution is not an abstract word. It refers to the process by which different kinds of living organisms are thought to have developed and diversified from earlier forms.


What are the kinds of noun based on perception?

Abstract nouns are based on perception; the noun perception is an abstract noun as well as such perceptions as beliefs, assumptions, prejudices, needs, convictions, opinions, etc.


Classes of partnership?

There are numerous different kinds of partnership organizations, or classes, that businesses can choose. Examples include Limited Partnerships and Limited Liability Limited Partnerships.


What kinds of problems may result if a student misses classes?

if the student misses his/her classes then he/she has to complete the pending work and will not get enough time for studies and graduallly they will decline acadamecally.