Re: [DM-dev] finally!! how does this sound?
Brought to you by:
acdalton,
henningsen
From: Henningsen <al...@gl...> - 2001-06-10 14:41:14
|
>Then we have various convenience functions in Dungeon: >DungeonElement * addRoom( x, y, w, h ); >DungeonElement * addDoor( x, y, w, h ); >DungeonElement * addWall( w, y, w, h ); >etc. >These are all functionaly identical except that they set the square type, so >they'll all just call: >DungeonElement * add( x, y, w, h, squaretype ) >which simply calls add( DungeonElement ) on the created element. Hmm, I wonder what happens when you addDoor in the middle of open space? Or a door that has all its wall on one side, none on the other? I think this could lead to problems with rooms, or make very complicated special-case-checking neccessary. So I'd prefer if we had two types of walls, walls with doors and walls without, but no doors as separate DungeonElements. The Wall without door could be the same class, just using a different constructor (or default values in the same constructor). And a higher level design program could have a function "AddDoorToWall", but in the dungeonmaker itself we'd only have doors as parts of walls. Would that mess up your plans? I'm pretty sure it would be simpler to code, and less error prone. Peter |