Login | Register  
View Article

Current Articles | Categories | Search | Syndication

Thoughts on Exits

I've been racking my brain to get Exits to be more programmer friendly. The answer just hit me, and I wanted do a brain dump, so that I don't lose this idea while it is still fresh in my mind.

Here are the two main memes that I had:

  • Instead of ExitA and ExitB, rename them to ExitTo and ExitFrom
  • Use something like the mediator pattern to deal with things like doors

The first one is so obvious that it gives me physical pain. I have no idea why something so simple didn't surface before. Must be that I was tired every time I looked at this issue. I still think that Foxedup original idea is pretty good, and these semantic changes will make it much easier to deal with.

The second meme is not so easy to explain. I've been studying design patterns in C# for some obstacles and research that I've been doing for the last 3 weeks. The mediator pattern jumped at me, because it could help decouple the doors (and other mud objects) from the exits. I would like to include this logic into the ExitBehavior class in the future.

I think I'm finally getting used to my new work schedule. I hope that I can return to finish coding WheelMUD's 0.5 milestone soon!

posted @ Thursday, March 10, 2011 8:59 PM by Fastalanasa

Previous Page | Next Page

COMMENTS

Hey buddy, long time no speak :)

There was a reason I didnt go with the ToFrom pattern and that was that an exit's to and from is context specific as the same exit object was used for both RoomA and RoomB.

If you were in RoomA and used the exit, it was the exits responsibility to decide ok, you came from RoomA therefore you are going to RoomB, and vice versa if you came from RoomB then you need to move to RoomA. The room has nothing to do with the decission, but it was the same exit instance linking the 2 rooms.

If you now think about the exit object, the ToFrom pattern doesnt make sense because if Im in RoomB then the exit needs to think of RoomA as the "To" room and RoomB as the "From" room, however if I'm in RoomB then the roles are reversed.

Hope that sheds a bit of light on the subject

posted @ Friday, March 18, 2011 6:51 AM by foxedup


Foxedup! It sure is nice to see you over here. :)

I got the basics down. My main thrust behind this is that we need to find a way to make this easier to use for builders. It always takes me a while to get the gist back, when I'm away from that code for a few months, and I've been part of this for years.

I have some ideas on how to make To and From work, without changing the code you wrote. I'll create a new topic in the forums so that we can move the discussion over there.

posted @ Monday, March 21, 2011 9:47 AM by Fastalanasa


Oh, sorry I missed the blog post until now. (Fell out of habit of checking that column.) Anyway I'm going to stick with discussion in the forum posts.

posted @ Saturday, March 26, 2011 9:33 PM by Karak


Only registered users may post comments.
Copyright 2007-2012 by WheelMUD  | Terms Of Use | Privacy Statement
Google Analytics Alternative