Skip to main content

Questions tagged [polymorphism]

Filter by
Sorted by
Tagged with
0 votes
1 answer
120 views

I'm using JsonConvert.DeserializeObject to deserialize animals from the Animal list, but unfortunately they get deserialized as Animals instead of their derived classes (Cat and Dog). As you can see, ...
Manuel Saraiva's user avatar
0 votes
0 answers
90 views

If I'm making a small library for handling 2D shapes, should polymorphism generally be avoided? I know that it can worsen performance but it's not like polymorphism is never used in game development ...
JensB's user avatar
  • 157
0 votes
1 answer
87 views

This is going to be a bit tricky but it is really bothering me so I hope you will have the patience to follow along :) Here is my very basic architecture: So in the framework, I am creating I have <...
Marc Rasmussen's user avatar
0 votes
0 answers
180 views

I have been learning a new method of programming. I have been programming many years and am recently finding out there is a better method in general via abstract classes. My question is how to ...
user2455808's user avatar
1 vote
1 answer
1k views

I'm currently fiddling around with some RPG mechanics and I'm trying to implement a solid way to handle items that have different on use effects. Currently, I have a base class called "Item" that ...
Grant Upson's user avatar
0 votes
2 answers
276 views

I am new to game development. Coming across the ECS (entity-component system) pattern I generally quite liked the idea. I have implemented the current version of my engine using the OOP style approach....
Adrian Albert Koch's user avatar
1 vote
1 answer
476 views

I want to be able to create Entities from different Component sets. I want to call Entity entity(new StaticObject(modelpath, position)); I have an EntityTypes ...
simulate's user avatar
  • 145
1 vote
1 answer
478 views

[Context] I am developing a game in Unity, and wanted to make a Game Manager. Like many examples out there, it uses a Singletron design pattern. But i have several other Managers, all using Singletron ...
Romulo Rocha's user avatar
2 votes
1 answer
3k views

So I have an ItemDatabase class which basically only has a list of Item ...
Tikkes's user avatar
  • 173
3 votes
1 answer
1k views

Straight to the facts. I have a base CEntity class for different entities in my game: Static entities ( those do not move, simply props and items ) Dynamic entities ( these move, jump ) Each of these ...
cdmstr's user avatar
  • 55
9 votes
3 answers
1k views

There are two classes in my game that are really useful, but slowly becoming a pain. Message and Property (property is essentially a component). They both derive from a base class and contain a ...
Bryan's user avatar
  • 235
1 vote
1 answer
2k views

I'm creating a simple 2d game with c++ and SFML, and I've got a simple framework going for animating a sprite using a "SpriteSheet" image (an big image containing all the "frames" of an animation) I'...
loogie's user avatar
  • 13
2 votes
2 answers
203 views

I have a base class called Attacker that has a update method. The update method moves ...
saiy2k's user avatar
  • 486