Re: Keeping Track of a game's storyline/objectivs

So call me stupid, call me an idiot, but I don't understand.
In post 3 there is a link to an observer pattern explanation. Really good for what it is, but I fail to see how useful it would be overall.
Suppose that we have a map with the player needing to reach certain coordinates. After they do so, they get a message stating that their objective changed and they need to head back. The observer pattern suggests to create a notify function for every observed object. In python, this could look like this:

class tile:
 def __init__(self, min_x, max_x, min_y, max_y, min_z, max_z, type):
  self.min_x, self.min_y, self.min_z, self.max_x, self.max_y, self.max_z, self.type = min_x, min_y, min_z, max_x, max_y, max_z, type
  self.observer_list = []
 def notify(self, x, y, z):
  for i in self.observer_list: i.notify("walked", x, y, z)

That's all well and good, but it becomes an issue with multiple maps when you add loading and saving into account. You'd need something that can export all of your items, observers, and map states. This seems like a lot of work. Is that typical?
I also didn't mention the nastiness of you triggering a notification every time you walk, but I am not sure how much of an impact on performance, if any, it's ultimately going to have.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Munawar via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Munawar via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Munawar via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Munawar via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : NicklasMCHD via Audiogames-reflector

Reply via email to