From my point of view

DELEGATES:
Well starting from delegates the best explanation would be with an example imagine you have a boss (enormous skeleton for example let’s call him Montro) Montro summons a group of other skeletons to help him hovewer they are alive as long as Montro is alive. So as you probally guess when Montro dies the other skeletons also have to die. Now we need to first play the “death” animation and then deactivate/destroy objects. Without delegates you would have to get ALL instances of those skeletons and Montro and then play their animation. With delegates you would simply create it assign it at Start() method and with the same time you would use it you so ALL neccessary things with ALL objects that it call their method to die!

OBSERVER PATTERN:
It a preety straightforward explenation but i actually look that from hardware/recourses perpective remeber the lecture about bit shifting right when 1 << (int) layer so 000…0001 becomes 000.0100 for example that is performance (aside from that i agree with statement " Premature optimization is the root of all evil" but on the other hand if you “know” that something can be done better do that now leave more complex optimization for later like “Fog/distance/terrain creating”) . Now with Obvserver try to look that from code perpective do you want to call function every time or do you want to call function when something will ACTUALLY happen ? Yeah me too …

Privacy & Terms