Hosting courtesy of Sourceforge

SourceForge Logo
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

MapEditor.h

Go to the documentation of this file.
00001 //
00002 //                                 MapEditor.h
00003 //                             -------------------
00004 //    begin                : Tue Mar 19 2002
00005 //    copyright            : (C) 2002 by Rob Renaud
00006 //    email                : rrenaud@eden.rutgers.edu
00007 //
00008 //   This program is free software; you can redistribute it and/or modify
00009 //   it under the terms of the GNU General Public License as published by
00010 //   the Free Software Foundation; either version 2 of the License, or
00011 //   (at your option) any later version.
00012 //
00013 
00014 #ifndef MAP_EDITOR_H
00015 #define MAP_EDITOR_H
00016 
00017 #include "../Config.h"
00018 #include "TileSetEditor.h"
00019 #include "EditorTile.h"
00020 
00021 #include "../Game/GameMap.h"
00022 #include "../Game/MapLocation.h"
00023 #include "../Parse/ListParser.h"
00024 #include "../Util/Matrix.h"
00025 
00026 #include <string>
00027 
00028 namespace Editor {
00029         class MapEditor {
00030         public:
00031 
00032                 MapEditor(const std::string& filename);
00033                 ~MapEditor();
00034                 void saveMap();
00035                 void changeMapName(const std::string& newName);
00036                 void draw(SDL_Surface* surf);
00037                 void handleMouseClick(SDL_MouseButtonEvent& mouseEvent);
00038         private:
00039 
00040                 struct WndPos {
00041                         static const int TILE_MAT_HORIZ_OFFSET;  // how far left edge of tile matrix is from left edge of screen
00042                         static const int TILE_MAT_VERT_OFFSET;   // how far upper edge of tile matrix is from top edge of screen
00043                         static const int TILE_SET_HORIZ_OFFSET;  // how far left edge of tile set is from right edge of tile matrix
00044                         static const int TILE_SET_VERT_OFFSET;   // how far above/below the tile set is from the top edge of tile matrix
00045                 };
00046 
00047                 class EditorTileMatrixReader : public Parse::ParseAction {
00048                 public:
00049                         EditorTileMatrixReader(MapEditor& ed);
00050                         void getValue(std::istream& in);
00051                         void finishingAction();
00052                 private:
00053                         MapEditor& editor;
00054                 };
00055 
00056                 friend class EditorTileMatrixReader;
00057 
00058                 void toggleStartLoc(int row, int col); // adds tile loc to map if it doesn't exist, removes it if it does
00059                 Util::Matrix<EditorTile*> tileMatrix;
00060                 TileSetEditor tileSetEd;
00061                 std::list<Game::MapLocation*> startLocs;
00062                 std::string filename;
00063                 Graphics::DrawableAt* startLocPic;
00064         };
00065 };
00066 
00067 #endif // ifndef MAP_EDITOR_H
00068 

Generated on Tue May 21 07:26:51 2002 for BomberLAN by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001