netpanzer-cvs
[Top][All Lists]
Advanced

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

[netPanzer-CVS] netpanzer ./ChangeLog src/Makefile.am src/Lib/2...


From: Ivo Danihelka
Subject: [netPanzer-CVS] netpanzer ./ChangeLog src/Makefile.am src/Lib/2...
Date: Tue, 23 Sep 2003 08:14:05 -0400

CVSROOT:        /cvsroot/netpanzer
Module name:    netpanzer
Branch:         
Changes by:     Ivo Danihelka <address@hidden>  03/09/23 08:14:04

Modified files:
        .              : ChangeLog 
        src            : Makefile.am 
        src/Lib/2D     : Palette.cpp 
        src/NetPanzer/Classes: UnitID.hpp 
        src/NetPanzer/Interfaces: GameManager.cpp UnitInterface.cpp 
Added files:
        src/Bot        : Bot.cpp Bot.hpp BotPlayer.cpp BotPlayer.hpp 
                         BotTask.hpp BotTaskList.cpp BotTaskList.hpp 

Log message:
        Added bots, press 'b' for enable

Patches:
Index: netpanzer/ChangeLog
diff -u netpanzer/ChangeLog:1.2 netpanzer/ChangeLog:1.3
--- netpanzer/ChangeLog:1.2     Mon Sep 22 09:53:47 2003
+++ netpanzer/ChangeLog Tue Sep 23 08:14:03 2003
@@ -1,3 +1,6 @@
+23-Sep-2003 by Ivo Danihelka
+-Added bots, press 'b' for enable
+
 22-Sep-2003 by Matthias Braun
 -Commited automake stuff from Ivo and merged his autoconf script with mine
 -small cleanups/compile fixes
Index: netpanzer/src/Lib/2D/Palette.cpp
diff -u netpanzer/src/Lib/2D/Palette.cpp:1.10 
netpanzer/src/Lib/2D/Palette.cpp:1.11
--- netpanzer/src/Lib/2D/Palette.cpp:1.10       Tue Sep 16 16:16:09 2003
+++ netpanzer/src/Lib/2D/Palette.cpp    Tue Sep 23 08:14:04 2003
@@ -18,7 +18,6 @@
 #include <config.h>
 
 #include "Palette.hpp"
-#include "FileUtil.hpp"
 #include "FileSystem.hpp"
 #include "Exception.hpp"
 #include "UtilInterface.hpp"
Index: netpanzer/src/Makefile.am
diff -u netpanzer/src/Makefile.am:1.1 netpanzer/src/Makefile.am:1.2
--- netpanzer/src/Makefile.am:1.1       Sun Sep 21 14:30:35 2003
+++ netpanzer/src/Makefile.am   Tue Sep 23 08:14:03 2003
@@ -3,6 +3,7 @@
 bin_PROGRAMS = netpanzer
 
 netpanzer_CPPFLAGS = -ILib/2D \
+    -IBot \
     -ILib/View \
     -ILib \
     -ILib/Interfaces \
@@ -35,6 +36,13 @@
 netpanzer_LDFLAGS = $(XML_LIBS) $(SDL_LIBS) $(SDLNET_LIBS) $(SDLMIXER_LIBS) \
                  $(SDLIMAGE_LIBS) $(PHYSFS_LIBS)
 netpanzer_SOURCES = \
+    Bot/Bot.cpp \
+    Bot/Bot.hpp \
+    Bot/BotPlayer.cpp \
+    Bot/BotPlayer.hpp \
+    Bot/BotTask.hpp \
+    Bot/BotTaskList.cpp \
+    Bot/BotTaskList.hpp \
     Lib/2D/Color.cpp \
     Lib/2D/Color.hpp \
     Lib/2D/ColorTable.cpp \
@@ -94,8 +102,6 @@
     Lib/Exception.hpp \
     Lib/FileSystem.cpp \
     Lib/FileSystem.hpp \
-    Lib/FileUtil.cpp \
-    Lib/FileUtil.hpp \
     Lib/FindFirst.cpp \
     Lib/FindFirst.hpp \
     Lib/LibView.cpp \
Index: netpanzer/src/NetPanzer/Classes/UnitID.hpp
diff -u netpanzer/src/NetPanzer/Classes/UnitID.hpp:1.4 
netpanzer/src/NetPanzer/Classes/UnitID.hpp:1.5
--- netpanzer/src/NetPanzer/Classes/UnitID.hpp:1.4      Tue Sep 16 16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/UnitID.hpp  Tue Sep 23 08:14:04 2003
@@ -68,6 +68,14 @@
         return false;
     }
 
+    inline bool operator<( const UnitID& Uid ) const
+    {
+        return (player < Uid.player
+                || (player == Uid.player && index < Uid.index)
+                || (player == Uid.player && index == Uid.index
+                    && unique < Uid.unique));
+    }
+
     inline bool playerEqual( const UnitID& Uid ) const
     {
         if ( (player == Uid.player) )
Index: netpanzer/src/NetPanzer/Interfaces/GameManager.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.50 
netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.51
--- netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.50     Mon Sep 22 
11:30:27 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameManager.cpp  Tue Sep 23 08:14:04 2003
@@ -128,6 +128,7 @@
 #include "FontSystem2D.hpp"
 #include "Math.hpp"
 
+#include "Bot.hpp"
 
 #define _MAX_INITIALIZE_PROCS (10)
 #define _MAX_DEDICATED_INITIALIZE_PROCS (8)
@@ -485,6 +486,16 @@
 
 void GameManager::processSystemKeys()
 {
+    static bool toggleBot = false;
+    if (KeyboardInterface::getKeyPressed(SDLK_b)) {
+        toggleBot = !toggleBot;
+        LOGGER.info("Bot enable=%d", toggleBot ? 1 : 0);
+    }
+    if (toggleBot) {
+        Bot::bot()->processEvents();
+    }
+
+
     if (Desktop::getVisible("GameView")) {
 
         if (KeyboardInterface::getKeyPressed( SDLK_F5 )) {
Index: netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp:1.9 
netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp:1.10
--- netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp:1.9    Mon Sep 22 
09:53:52 2003
+++ netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp        Tue Sep 23 
08:14:04 2003
@@ -355,8 +355,8 @@
             unit = new Archer ( location, color_flag, unit_flag );
         }
         break;
-
-
+    default:
+        assert("unknown unit_type" == 0);
     } // ** switch
 
     return( unit );




reply via email to

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