pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] [pingus] 2 new revisions pushed by address@hidden on 2011-1


From: pingus
Subject: [Pingus-CVS] [pingus] 2 new revisions pushed by address@hidden on 2011-10-30 04:25 GMT
Date: Sun, 30 Oct 2011 04:29:38 +0000

2 new revisions:

Revision: e22de9fecff8
Author:   Ingo Ruhnke <address@hidden>
Date:     Sat Oct 29 21:25:32 2011
Log:      Adapted to new API
http://code.google.com/p/pingus/source/detail?r=e22de9fecff8

Revision: 09cb621e26e6
Author:   Ingo Ruhnke <address@hidden>
Date:     Sat Oct 29 21:25:49 2011
Log:      Added ability to print actions to pingus-level
http://code.google.com/p/pingus/source/detail?r=09cb621e26e6

==============================================================================
Revision: e22de9fecff8
Author:   Ingo Ruhnke <address@hidden>
Date:     Sat Oct 29 21:25:32 2011
Log:      Adapted to new API

http://code.google.com/p/pingus/source/detail?r=e22de9fecff8

Modified:
 /extra/pingus-levelset.cpp

=======================================
--- /extra/pingus-levelset.cpp  Tue Oct  4 05:09:50 2011
+++ /extra/pingus-levelset.cpp  Sat Oct 29 21:25:32 2011
@@ -94,17 +94,17 @@
     for(auto it = files.begin(); it != files.end(); ++it)
     {
       const Pathname& path = *it;
-      Levelset levelset(path);
+      std::unique_ptr<Levelset> levelset = Levelset::from_file(path);

       if (mode == 0)
       {
         std::cout << "filename      : " << path << std::endl;
- std::cout << "title : " << levelset.get_title() << std::endl; - std::cout << "description : " << levelset.get_description() << std::endl; + std::cout << "title : " << levelset->get_title() << std::endl; + std::cout << "description : " << levelset->get_description() << std::endl;
         std::cout << "levels        : " << std::endl;
-        for(int i = 0; i < levelset.get_level_count(); ++i)
-        {
-          std::cout << "  " << levelset.get_level(i)->resname << std::endl;
+        for(int i = 0; i < levelset->get_level_count(); ++i)
+        {
+ std::cout << " " << levelset->get_level(i)->resname << std::endl;
         }
         std::cout << std::endl;
       }
@@ -117,19 +117,19 @@

         if (mode & kTitle)
         {
-          std::cout << levelset.get_title() << std::endl;
+          std::cout << levelset->get_title() << std::endl;
         }

         if (mode & kDescription)
         {
-          std::cout << levelset.get_description() << std::endl;
+          std::cout << levelset->get_description() << std::endl;
         }

         if (mode & kLevels)
         {
-          for(int i = 0; i < levelset.get_level_count(); ++i)
-          {
- std::cout << " " << levelset.get_level(i)->resname << std::endl;
+          for(int i = 0; i < levelset->get_level_count(); ++i)
+          {
+ std::cout << " " << levelset->get_level(i)->resname << std::endl;
           }
           std::cout << std::endl;
         }

==============================================================================
Revision: 09cb621e26e6
Author:   Ingo Ruhnke <address@hidden>
Date:     Sat Oct 29 21:25:49 2011
Log:      Added ability to print actions to pingus-level

http://code.google.com/p/pingus/source/detail?r=09cb621e26e6

Modified:
 /extra/pingus-level.cpp

=======================================
--- /extra/pingus-level.cpp     Sun Oct  9 15:19:28 2011
+++ /extra/pingus-level.cpp     Sat Oct 29 21:25:49 2011
@@ -16,7 +16,8 @@
     kDescription = (1<<3),
     kMusic       = (1<<4),
     kFilename    = (1<<5),
-    kSize        = (1<<6)
+    kSize        = (1<<6),
+    kActions     = (1<<7)
   };

   unsigned int mode = 0;
@@ -32,6 +33,7 @@
   argp.add_option('c', "checksum", "", "Display checksum of the level");
argp.add_option('d', "description", "", "Display description of the level");
   argp.add_option('m', "music", "", "Display music of the level");
+  argp.add_option('A', "actions", "", "Display actions");
   argp.add_option('f', "filename", "", "Display filename of the level");

   argp.parse_args(argc, argv);
@@ -50,6 +52,10 @@
         mode |= kAuthor;
         break;

+      case 'A':
+        mode |= kActions;
+        break;
+
       case 'n':
         mode |= kName;
         break;
@@ -145,6 +151,16 @@
         {
           std::cout << plf.get_music() << std::endl;
         }
+
+        if (mode & kActions)
+        {
+          auto actions = plf.get_actions();
+ for(auto action = actions.begin(); action != actions.end(); ++action)
+          {
+            std::cout << action->first << ":" << action->second << " ";
+          }
+          std::cout << std::endl;
+        }
       }
     }
   }



reply via email to

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