diff --git a/source/code/BlockGame.cpp b/source/code/BlockGame.cpp index 1c1dd09..1ec7426 100644 --- a/source/code/BlockGame.cpp +++ b/source/code/BlockGame.cpp @@ -1832,76 +1832,6 @@ void BlockGame::Update(unsigned int newtick) { UpdateInternal(newtick); } -void BlockGame::PerformAction(unsigned int tick, int action, string param) { - ss.str(std::string()); - ss.clear(); - ss << param; - int p1,p2; - int p3; - switch (action) { - case ACTION_UPDATE: - UpdateInternal(tick); - break; - case ACTION_MOVECURSOR: - MoveCursor(param.at(0)); - break; - case ACTION_MOVECURSORTO: { - - int p1,p2; - ss >> p1 >> p2; - MoveCursorTo(p1,p2); - } - break; - case ACTION_SWITCH: - SwitchAtCursor(); - break; - case ACTION_PUSH: - PushLine(); - break; - case ACTION_CREATEGARBAGE: { - ss >> p1 >> p2; - CreateGarbage(p1,p2); - } - break; - case ACTION_CREATEGRAYGARBAGE: - CreateGreyGarbage(); - break; - case ACTION_GAMEOVER: - SetGameOver(); - break; - case ACTION_WIN: - setPlayerWon(); - break; - case ACTION_DRAW: - setDraw(); - break; - case ACTION_GAMESPEED: - ss >> p1; - setGameSpeed(p1); - break; - case ACTION_HANDICAP: - ss >> p1; - setHandicap(p1); - break; - case ACTION_NEW: - break; - case ACTION_NEWTT: - timetrial = true; - break; - case ACTION_NEWVS: - break; - case ACTION_STARTBLOCKS: - ss >> p3; - putStartBlocks(p3); - break; - case ACTION_NOP: - break; - default: - cerr << "Unknown action: " << action << " " << param << endl; - break; - }; -} - bool BlockGame::isSinglePuzzle() const { return singlePuzzle; } diff --git a/source/code/BlockGame.hpp b/source/code/BlockGame.hpp index dbe877b..5c82c67 100644 --- a/source/code/BlockGame.hpp +++ b/source/code/BlockGame.hpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ Source information and contacts persons can be found at -http://blockattack.net +http://www.blockattack.net =========================================================================== */ @@ -31,24 +31,6 @@ http://blockattack.net #define BLOCKWAIT 100000 #define BLOCKHANG 1000 -#define ACTION_UPDATE 0 -#define ACTION_MOVECURSOR 1 -#define ACTION_MOVECURSORTO 2 -#define ACTION_SWITCH 3 -#define ACTION_PUSH 4 -#define ACTION_CREATEGARBAGE 5 -#define ACTION_CREATEGRAYGARBAGE 6 -#define ACTION_GAMEOVER 7 -#define ACTION_WIN 8 -#define ACTION_DRAW 9 -#define ACTION_GAMESPEED 10 -#define ACTION_HANDICAP 11 -#define ACTION_NEW 12 -#define ACTION_NEWTT 13 -#define ACTION_NEWVS 14 -#define ACTION_STARTBLOCKS 15 -#define ACTION_NOP 16 - enum stageButton {SBdontShow, SBstageClear, SBpuzzleMode}; extern stageButton stageButtonStatus; @@ -152,10 +134,7 @@ public: std::string name; public: - //Constructor BlockGame(); - - //It should work now and can be used if we want to assign more players in network games that we need to free later virtual ~BlockGame(); void setGameSpeed(int globalSpeedLevel); @@ -207,15 +186,6 @@ public: //Generates a new line and moves the field one block up (restart puzzle mode) void PushLine(); void Update(unsigned int newtick); - void PerformAction(unsigned int tick, int action, std::string param); - /** - * - * @param tick Tick of the action - * @param action The action - * @param param Params. - * @return 1 if an action was selected - */ - int GotAction(unsigned int &tick, int &action, std::string ¶m); //Prints "winner" and ends game void setPlayerWon(); //void SetGameOver();