samedi 3 janvier 2015

Unsure about the decorator design pattern


I'm fairly new at using design patterns and I am currently making a small game for my uni course that I have to use the decorator pattern for creating the different classes of NPC however I think that I have misunderstood how the decorator pattern works.


At the moment all what changes between the classes of NPC's are the attack value, health and speed stats. What I am really unsure of is if there is a way of passing these values into the decorated object from the decorator or do i have the wrong impression of the decorator pattern.





Aucun commentaire:

Enregistrer un commentaire