Finally! A Use!
Posted in Tech
First watch, 3 bells (9:47 pm)

I have finally got a project that can use a std::deque. Up to this point, I have never bothered with them. I was just looking around for a vector-like object in the STL that has fast pop/push on the front and back of the array, and I didn't want to use a linked-list. I give you: std::deque!

For the MUD I've been writing, I plan on having a set of "overlay" maps, ASCII text files the same size as the main map that show changing states such as weather, sunlight, etc. An overlay with a sine wave line through it can represent the border between day and night (as well as dusk, dawn, and other relative values). By shifting this map progressively in one direction, you can simulate the rotation of the planet. The cool thing is by using a sine wave you can leave very high and very low latitudes with full-time daylight or night!

The problem becomes more complicated with weather such as clouds, rain, etc., because you don't want to shift everything across the entire world in the same direction. Well, you could, but it's cheesy. Anyway, I'm excited about coming up with an actual reason to use a std::deque.

Leave a Comment »