summaryrefslogtreecommitdiff
path: root/noncore/games/kbill/Scorelist.cc
authormark <mark>2002-04-14 17:08:03 (UTC)
committer mark <mark>2002-04-14 17:08:03 (UTC)
commitbfeb067c8acfb5f1797fdc886ac71ca1b10ccf57 (patch) (side-by-side diff)
treead77e90c90f4bfb598bbe93aa4b3e14b689c96f4 /noncore/games/kbill/Scorelist.cc
parenta0fe593db4e700989cc19e28b67a58f87823afeb (diff)
downloadopie-bfeb067c8acfb5f1797fdc886ac71ca1b10ccf57.zip
opie-bfeb067c8acfb5f1797fdc886ac71ca1b10ccf57.tar.gz
opie-bfeb067c8acfb5f1797fdc886ac71ca1b10ccf57.tar.bz2
Import of kbill
Diffstat (limited to 'noncore/games/kbill/Scorelist.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/kbill/Scorelist.cc75
1 files changed, 75 insertions, 0 deletions
diff --git a/noncore/games/kbill/Scorelist.cc b/noncore/games/kbill/Scorelist.cc
new file mode 100644
index 0000000..8825373
--- a/dev/null
+++ b/noncore/games/kbill/Scorelist.cc
@@ -0,0 +1,75 @@
+#include <qstring.h>
+#ifdef KDEVER
+#include <kapplication.h>
+#include <kstandarddirs.h>
+#endif
+#include "objects.h"
+
+FILE *Scorelist::open_file(char *mode) {
+// QString file;
+// file.sprintf("%s/kbill/scores", (const char *)locate("data",""));
+// //kdDebug() << locate("data","") << endl;
+// return fopen (file, mode);
+}
+
+void Scorelist::read() {
+// FILE *scorefile = open_file("r");
+// int i;
+// if (scorefile) {
+// for (i=0; i<10; i++) {
+// fgets (name[i], 21, scorefile);
+// fscanf (scorefile, "%d%d\n", &(level[i]), &(score[i]));
+// }
+// fclose(scorefile);
+// }
+// else
+// for (i=0; i<10; i++) {
+// strcpy(name[i], "me");
+// level[i] = score[i] = 0;
+// }
+}
+
+void Scorelist::write() {
+// int i, j;
+// FILE *scorefile = open_file("w");
+// if (!scorefile) return;
+// for (i=0; i<10; i++) {
+// fputs(name[i], scorefile);
+// for (j=strlen(name[i]); j<25; j++)
+// fputc(' ', scorefile);
+// fprintf (scorefile, " %d %d\n", level[i], score[i]);
+// }
+// fclose(scorefile);
+}
+
+/* Add new high score to list */
+void Scorelist::recalc (char *str) {
+// int i;
+// if (score[9] >= game.score) return;
+// for (i=9; i>0; i--) {
+// if (score[i-1] < game.score) {
+// strcpy (name[i], name[i-1]);
+// level[i] = level[i-1];
+// score[i] = score[i-1];
+// }
+// else break;
+// }
+// strcpy (name[i], str);
+// level[i] = game.level;
+// score[i] = game.score;
+}
+
+void Scorelist::update() {
+// char str[500], temp[40];
+// int i, j;
+// strcpy (str,"High Scores:\n\n");
+// strcat (str, "Name Level Score\n");
+// for (i=0; i<10; i++) {
+// strcat (str, name[i]);
+// for (j=strlen(name[i]); j<21; j++) strcat (str, " ");
+// sprintf (temp, "%5d %7d\n", level[i], score[i]);
+// strcat (str, temp);
+// }
+// ui.update_hsbox(str);
+}
+