windstille-devel
[Top][All Lists]
Advanced

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

[Windstille-devel] rev 356 - trunk/src


From: Ingo Ruhnke
Subject: [Windstille-devel] rev 356 - trunk/src
Date: Fri, 28 May 2004 19:52:42 +0200

Author: grumbel
Date: 2004-05-28 19:52:41 +0200 (Fri, 28 May 2004)
New Revision: 356

Added:
   trunk/src/command.cxx
   trunk/src/command_impl.hxx
Log:
- some command cleanup

Added: trunk/src/command.cxx
===================================================================
--- trunk/src/command.cxx       2004-05-28 17:50:39 UTC (rev 355)
+++ trunk/src/command.cxx       2004-05-28 17:52:41 UTC (rev 356)
@@ -0,0 +1,56 @@
+//  $Id$
+//
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 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 2
+//  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, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+#include <string>
+#include "command.hxx"
+
+Command::Command()
+{
+}
+
+Command::Command(const SharedPtr<CommandImpl>& impl_)
+  : impl(impl_)
+{
+}
+
+void
+Command::execute()
+{
+  impl->execute();
+}
+  
+void
+Command::redo()
+{
+  impl->redo();
+}
+
+void
+Command::undo()
+{
+  impl->undo();
+}
+
+std::string
+Command::serialize()
+{
+  return impl->serialize();
+}
+
+/* EOF */

Added: trunk/src/command_impl.hxx
===================================================================
--- trunk/src/command_impl.hxx  2004-05-28 17:50:39 UTC (rev 355)
+++ trunk/src/command_impl.hxx  2004-05-28 17:52:41 UTC (rev 356)
@@ -0,0 +1,43 @@
+//  $Id$
+// 
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 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 2
+//  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, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+#ifndef HEADER_COMMAND_IMPL_HXX
+#define HEADER_COMMAND_IMPL_HXX
+
+/** */
+class CommandImpl
+{
+private:
+public:
+  /** Execute the command */
+  virtual void execute() =0;
+
+  /** Execute the command a second time after the command got
+      undo'ed */
+  virtual void redo() =0;
+
+  /** Undo the effects caused by execute() */
+  virtual void undo() =0;
+
+  virtual std::string serialize() =0;
+};
+
+#endif
+
+/* EOF */





reply via email to

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