pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r3673 - in trunk/pingus: . src src/worldmap


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3673 - in trunk/pingus: . src src/worldmap
Date: Fri, 4 Jul 2008 21:09:35 +0200

Author: grumbel
Date: 2008-07-04 21:09:34 +0200 (Fri, 04 Jul 2008)
New Revision: 3673

Added:
   trunk/pingus/src/worldmap/pingus_worldmap.cpp
   trunk/pingus/src/worldmap/pingus_worldmap.hpp
Modified:
   trunk/pingus/SConstruct
   trunk/pingus/src/story_screen.hpp
   trunk/pingus/src/worldmap/worldmap_story.hpp
Log:
Created PingusWorldmap class to split the file handling out of the main 
Worldmap class

Modified: trunk/pingus/SConstruct
===================================================================
--- trunk/pingus/SConstruct     2008-07-04 18:58:36 UTC (rev 3672)
+++ trunk/pingus/SConstruct     2008-07-04 19:09:34 UTC (rev 3673)
@@ -255,6 +255,7 @@
 'src/worldmap/path_drawable.cpp', 
 'src/worldmap/path_graph.cpp', 
 'src/worldmap/pingus.cpp', 
+'src/worldmap/pingus_worldmap.cpp', 
 'src/worldmap/sprite_drawable.cpp', 
 'src/worldmap/surface_drawable.cpp', 
 'src/worldmap/worldmap.cpp', 

Modified: trunk/pingus/src/story_screen.hpp
===================================================================
--- trunk/pingus/src/story_screen.hpp   2008-07-04 18:58:36 UTC (rev 3672)
+++ trunk/pingus/src/story_screen.hpp   2008-07-04 19:09:34 UTC (rev 3673)
@@ -26,14 +26,14 @@
 class StoryScreenComponent;
 
 using namespace WorldmapNS;
-
+
 /** */
 class StoryScreen : public GUIScreen
 {
 private:
   StoryScreenComponent* story_comp;
 public:
-       StoryScreen(WorldmapStory *pages);
+  StoryScreen(WorldmapStory *pages);
   ~StoryScreen();
 
   void on_startup();
@@ -43,8 +43,7 @@
   StoryScreen (const StoryScreen&);
   StoryScreen& operator= (const StoryScreen&);
 };
-
-
+
 #endif
 
 /* EOF */

Added: trunk/pingus/src/worldmap/pingus_worldmap.cpp
===================================================================
--- trunk/pingus/src/worldmap/pingus_worldmap.cpp       2008-07-04 18:58:36 UTC 
(rev 3672)
+++ trunk/pingus/src/worldmap/pingus_worldmap.cpp       2008-07-04 19:09:34 UTC 
(rev 3673)
@@ -0,0 +1,106 @@
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2008 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//  
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//  
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#include <string>
+#include "pingus_worldmap.hpp"
+
+class PingusWorldmapImpl
+{
+public:
+  std::string name;
+  std::string short_name;
+  std::string description;
+  std::string music;
+  std::string author;
+  std::string email;
+  int width;
+  int height;
+
+  std::string default_node;
+  std::string final_node;
+
+};
+
+PingusWorldmap::PingusWorldmap()
+{
+}
+
+PingusWorldmap::PingusWorldmap(const Pathname& pathname)
+{
+}
+
+
+std::string
+PingusWorldmap::get_name() const 
+{
+  return impl->name; 
+}
+
+std::string
+PingusWorldmap::get_short_name() const
+{
+  return impl->short_name;
+}
+
+std::string
+PingusWorldmap::get_description() const
+{
+  return impl->description;
+}
+
+std::string
+PingusWorldmap::get_music() const
+{
+  return impl->music;
+}
+
+std::string
+PingusWorldmap::get_author() const
+{
+  return impl->author;
+}
+
+std::string
+PingusWorldmap::get_email() const
+{
+  return impl->email;
+}
+
+int
+PingusWorldmap::get_width() const
+{
+  return impl->width;
+}
+
+int
+PingusWorldmap::get_height() const
+{
+  return impl->height;
+}
+
+std::string
+PingusWorldmap::get_default_node() const
+{
+  return impl->default_node;
+}
+
+std::string
+PingusWorldmap::get_final_node() const
+{
+  return impl->final_node;
+}
+
+/* EOF */


Property changes on: trunk/pingus/src/worldmap/pingus_worldmap.cpp
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: trunk/pingus/src/worldmap/pingus_worldmap.hpp
===================================================================
--- trunk/pingus/src/worldmap/pingus_worldmap.hpp       2008-07-04 18:58:36 UTC 
(rev 3672)
+++ trunk/pingus/src/worldmap/pingus_worldmap.hpp       2008-07-04 19:09:34 UTC 
(rev 3673)
@@ -0,0 +1,58 @@
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2008 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//  
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//  
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef HEADER_PINGUS_WORLDMAP_HPP
+#define HEADER_PINGUS_WORLDMAP_HPP
+
+#include <boost/smart_ptr.hpp>
+#include "worldmap_story.hpp"
+#include "path_graph.hpp"
+#include "../pathname.hpp"
+
+class PingusWorldmapImpl;
+
+/** */
+class PingusWorldmap
+{
+private:
+public:
+  PingusWorldmap();
+  PingusWorldmap(const Pathname& pathname);
+
+  std::string get_name() const;
+  std::string get_short_name() const;
+  std::string get_description() const;
+  std::string get_music() const;
+  std::string get_author() const;
+  std::string get_email() const;
+  int get_width() const;
+  int get_height() const;
+
+  std::string get_default_node() const;
+  std::string get_final_node() const;
+
+  WorldmapNS::WorldmapStory get_intro_story() const;
+  WorldmapNS::WorldmapStory get_end_story() const;
+
+  WorldmapNS::PathGraph get_graph() const;
+
+protected:
+  boost::shared_ptr<PingusWorldmapImpl> impl;
+};
+
+#endif
+
+/* EOF */


Property changes on: trunk/pingus/src/worldmap/pingus_worldmap.hpp
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: trunk/pingus/src/worldmap/worldmap_story.hpp
===================================================================
--- trunk/pingus/src/worldmap/worldmap_story.hpp        2008-07-04 18:58:36 UTC 
(rev 3672)
+++ trunk/pingus/src/worldmap/worldmap_story.hpp        2008-07-04 19:09:34 UTC 
(rev 3673)
@@ -20,45 +20,44 @@
 #include <vector>
 #include <string>
 #include "../res_descriptor.hpp"
+      
+class FileReader;
 
-       
-       class FileReader;
+class StoryPage
+{
+public:
+  StoryPage() {}
 
-       class StoryPage
-       {
-       public:
-               StoryPage() {}
-
-               StoryPage(ResDescriptor arg_image, std::string arg_text, 
std::string arg_name = "")
-                       : image(arg_image), text(arg_text), page_name(arg_name)
-               {
+  StoryPage(ResDescriptor arg_image, std::string arg_text, std::string 
arg_name = "")
+    : image(arg_image), text(arg_text), page_name(arg_name)
+  {
                
-               }
+  }
 
-               ResDescriptor image;
-               std::string   text;
-               std::string             page_name;
-       };
+  ResDescriptor image;
+  std::string   text;
+  std::string  page_name;
+};
 
 namespace WorldmapNS {
+
+class WorldmapStory
+{
+public:
+  WorldmapStory(const FileReader &reader);
+  ~WorldmapStory() { }
 
-       class WorldmapStory
-       {
-       public:
-               WorldmapStory(const FileReader &reader);
-               ~WorldmapStory() { }
+  std::string get_title() const { return title; }
+  std::string get_music() const { return music; }
+  std::vector<StoryPage> get_pages() const { return pages; }
 
-               std::string get_title() const { return title; }
-               std::string get_music() const { return music; }
-               std::vector<StoryPage> get_pages() const { return pages; }
+private:
+  std::string title;
+  std::string music;
+  std::vector<StoryPage> pages;
 
-       private:
-               std::string title;
-               std::string music;
-               std::vector<StoryPage> pages;
-
-       };      // class WorldmapStory
-
+};
+
 }      // namespace WorldmapNS
 
 #endif





reply via email to

[Prev in Thread] Current Thread [Next in Thread]