author | zecke <zecke> | 2004-09-10 11:14:02 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-10 11:14:02 (UTC) |
commit | b8baf551919868737c6f56a05e6efa1bad4d97ac (patch) (side-by-side diff) | |
tree | 402c587e55356aff7f13990e1efcf57775bb9670 /noncore/games/kbill | |
parent | 046bff8abb6727f5522748a2dc8a259d27b5979b (diff) | |
download | opie-b8baf551919868737c6f56a05e6efa1bad4d97ac.zip opie-b8baf551919868737c6f56a05e6efa1bad4d97ac.tar.gz opie-b8baf551919868737c6f56a05e6efa1bad4d97ac.tar.bz2 |
Remove unused parameter
-rw-r--r-- | noncore/games/kbill/Game.cc | 14 | ||||
-rw-r--r-- | noncore/games/kbill/Game.h | 2 | ||||
-rw-r--r-- | noncore/games/kbill/field.cpp | 2 | ||||
-rw-r--r-- | noncore/games/kbill/inputbox.cpp | 10 | ||||
-rw-r--r-- | noncore/games/kbill/kbill.h | 42 |
5 files changed, 36 insertions, 34 deletions
diff --git a/noncore/games/kbill/Game.cc b/noncore/games/kbill/Game.cc index 624b50b..4cd5322 100644 --- a/noncore/games/kbill/Game.cc +++ b/noncore/games/kbill/Game.cc @@ -37,141 +37,141 @@ void Game::setup_level (unsigned int lev) { iteration = efficiency = 0; } void Game::start(unsigned int lev) { state = PLAYING; score = 0; ui.restart_timer(); ui.set_pausebutton(true); setup_level(lev); } void Game::quit() { exit(0); } void Game::update_info() { static char str[80]; sprintf (str, "Bill:%d/%d System:%d/%d/%d Level:%d Score:%d", bill.on_screen, bill.off_screen, net.base, net.off, net.win, level, score); ui.draw_str(str, 5, scrheight-5); efficiency += ((100*net.base-10*net.win)/net.units); } - + void Game::update_score (int action) { switch (action){ case ENDLEVEL: score+=(level*efficiency/iteration); break; default: score+=(action*action*BILLPOINTS); } } void Game::warp_to_level (unsigned int lev) { if (state==PLAYING) { if (lev <= level) return; setup_level(lev); } else { - if (lev<=0) return; + if (lev <=0) return; start(lev); } } void Game::button_press(int x, int y) { int i, counter=0, flag=0; if (state != PLAYING) return; ui.set_cursor(DOWNC); if (bucket.clicked(x, y)) { ui.set_cursor(BUCKETC); grabbed = BUCKET; } for (i=0; i < bill.MAX_BILLS && !flag; i++) { if (bill.list[i].state == bill.list[i].OFF || bill.list[i].state == bill.list[i].DYING) continue; if (bill.list[i].state == bill.list[i].STRAY && bill.list[i].clickedstray(x, y)) { ui.set_cursor (bill.list[i].cargo); grabbed = i; flag = 1; } else if (bill.list[i].state != bill.list[i].STRAY && bill.list[i].clicked(x, y)) { - if (bill.list[i].state == bill.list[i].AT) + if (bill.list[i].state == bill.list[i].AT) net.computers[bill.list[i].target_c].busy=0; bill.list[i].index = -1; bill.list[i].cels = bill.dcels; bill.list[i].x_offset = -2; bill.list[i].y_offset = -15; bill.list[i].state = bill.list[i].DYING; counter++; } } if (counter) update_score(counter); } void Game::button_release(int x, int y) { int i; ui.set_cursor (DEFAULTC); if (state != PLAYING || grabbed == EMPTY) return; if (grabbed == BUCKET) { grabbed = EMPTY; for (i=0; i<net.ncables; i++) if (net.cables[i].onspark(x, y)) { net.cables[i].active=0; net.cables[i].delay = spark.delay(level); } return; } for (i=0; i<net.units; i++) if (net.computers[i].oncomputer(x, y) && net.computers[i].compatible (bill.list[grabbed].cargo) && - (net.computers[i].os == OS.WINGDOWS || + (net.computers[i].os == OS.WINGDOWS || net.computers[i].os == OS.OFF)) { - net.base++; + net.base++; if (net.computers[i].os == OS.WINGDOWS) net.win--; else net.off--; net.computers[i].os = bill.list[grabbed].cargo; bill.list[grabbed].state = bill.list[grabbed].OFF; grabbed = EMPTY; return; } grabbed = EMPTY; -} +} void Game::update() { switch (state) { case PLAYING: - ui.clear(); + ui.clear(); bucket.draw(); net.update(); net.draw(); bill.update(); bill.draw(); update_info(); if (!(bill.on_screen+bill.off_screen)) { update_score(ENDLEVEL); state = BETWEEN; } if ((net.base+net.off)<=1) state = END; break; case END: ui.clear(); net.toasters(); net.draw(); ui.refresh(); ui.popup_dialog(ENDGAME); /* if (score > scores.score[9]) ui.popup_dialog(ENTERNAME); scores.update();*/ ui.popup_dialog(HIGHSCORE); ui.clear(); ui.draw_centered(logo); ui.kill_timer(); diff --git a/noncore/games/kbill/Game.h b/noncore/games/kbill/Game.h index 4473936..5c9c497 100644 --- a/noncore/games/kbill/Game.h +++ b/noncore/games/kbill/Game.h @@ -1,31 +1,31 @@ #ifndef GAME_H #define GAME_H #include "objects.h" class Game { - unsigned state; + int state; int efficiency; public: unsigned score, level, iteration; Picture logo; int grabbed; static const unsigned short scrwidth = 240; static const unsigned short scrheight = 290; static const int PLAYING = 1; static const int BETWEEN = 2; static const int END = 3; static const int WAITING = 4; static const int DEFAULTC = 0; /* cursors */ static const int DOWNC = -1; static const int BUCKETC = -2; static const int ENDGAME = 200; /* dialog window IDs */ static const int ENTERNAME = 201; static const int HIGHSCORE = 202; static const int SCORE = 203; static const int ENDLEVEL = -1; /* Codes for updating score */ diff --git a/noncore/games/kbill/field.cpp b/noncore/games/kbill/field.cpp index a974ab2..0dd8d72 100644 --- a/noncore/games/kbill/field.cpp +++ b/noncore/games/kbill/field.cpp @@ -59,25 +59,25 @@ void Field::leaveEvent(QEvent *) { if (timer->isActive() && playing) { playing = true; timer->stop(); } } void Field::stopTimer() { playing = false; if (timer->isActive()) timer->stop(); } void Field::startTimer() { playing = true; if (!timer->isActive()) timer->start(250, FALSE); } void Field::Timer(){ game.update(); } void Field::paintEvent(QPaintEvent *) { bitBlt(this, 0, 0, pix); -}
\ No newline at end of file +} diff --git a/noncore/games/kbill/inputbox.cpp b/noncore/games/kbill/inputbox.cpp index 5087fbb..7aaebe7 100644 --- a/noncore/games/kbill/inputbox.cpp +++ b/noncore/games/kbill/inputbox.cpp @@ -1,50 +1,50 @@ /*************************************************************************** inputbox.cpp - description ------------------- begin : Sat Jan 1 2000 copyright : (C) 2000 by Jurrien Loonstra email : j.h.loonstra@st.hanze.nl ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #include "inputbox.h" -InputBox::InputBox(QWidget *parent, const char *name, const char *caption, const char *text) : QDialog(parent, name, TRUE) { +InputBox::InputBox(QWidget *parent, const char *name, const char *, const char *) : QDialog(parent, name, TRUE) { // setCaption(caption); -// +// // question = new QLabel(this); // question->setText(text); // question->setGeometry(10, 10, 240, 50); -// +// // input = new QLineEdit(this); // input->setGeometry(10, 60, 240, 30); // input->setFocus(); // input->setMaxLength(19); -// +// // ok = new QPushButton( "Ok", this ); // ok->setGeometry(10, 100, 100,30 ); // ok->setDefault(TRUE); // connect( ok, SIGNAL(clicked()), SLOT(accept()) ); -// +// // cancel = new QPushButton( "Cancel", this ); // cancel->setGeometry(150, 100, 100,30 ); // connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); } InputBox::~InputBox(){ delete ok; delete cancel; delete question; delete input; } QString InputBox::getText() const{ return input->text(); } diff --git a/noncore/games/kbill/kbill.h b/noncore/games/kbill/kbill.h index fbc0c6c..da1a111 100644 --- a/noncore/games/kbill/kbill.h +++ b/noncore/games/kbill/kbill.h @@ -7,48 +7,50 @@ ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef KBILL_H #define KBILL_H #include <qmainwindow.h> #include <qwidget.h> #include <qpopupmenu.h> #include "field.h" class KBill : public QMainWindow { - Q_OBJECT - public: + Q_OBJECT +public: KBill(); - ~KBill(); - Field* getField(); - private: - QMenuBar *menu; - QPopupMenu *file, *help; - Field *field; - int pauseid; - protected slots: - void Quit(); - void About(); - void NewGame(); - void Pause(); - void WarpTo(); - void Story(); - void Rules(); - void ViewHighScores(); - - friend class UI; + ~KBill(); + Field* getField(); +private: + QMenuBar *menu; + QPopupMenu *file, *help; + Field *field; + int pauseid; + +protected slots: + void Quit(); + void About(); + void NewGame(); + void Pause(); + void WarpTo(); + void Story(); + void Rules(); + void ViewHighScores(); + +protected: + friend class UI; }; #endif |