Visitor and then some
So adding the visitor pattern was very peculiar to me… It was way to easy. I threw in the visitor interface, made a visitor whom looked at HP, and wrote the appropriate methods. Then threw in some accept visitors in the visitees, and voila, done. Only issue I encountered was that the decorators were also included in the visitee arena, which is bad. The problem is that when you decorate something, you change it’s type, so visit methods were needed for all decorations, and then the next problem was that decorators are not appropriate for the HP value thing. During lecture Kent came up with the idea of “stuffers” instead of “wrappers”, and since it sounds like doing this we would keep the objects being decorated their original type, this might work for my HP issue. Haven’t tried implementing it yet, but will soon. ALso, trying to comprehend the factory pattern, the book loves it, andit’s big. Will eventually stuff that monster into my code, but it will take some time. Feed back would be great. I have a question concerning the factory. I want to have invisible spawn points in my game, where monsters after a given interval of time and certain conditions met will spawn, as an independent monster with it’s own values. Is the factory pattern what I need? unfortunately I am kinda going off it’s name and trusting it does what it sounds like it does. Also, if we could have a closer look at that stuff idea, life would be great.