/* * pHatt - PalmOS(TM) Hattrick (http://www.hattrick.org) Manager Assistant * * phat.h - headers * * 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 PHATLOAD #define PHATLOAD #include #include "resource.h" #endif struct changes { Int8 form; Int8 experience; Int8 stamina; Int8 winging; Int8 goalie; Int8 defending; Int8 playmaking; Int8 scoring; Int8 passing; Int8 setting; Int32 value; }; /* Structures */ struct player { struct player *next; Char *name; Int32 id; Int8 age; Int8 form; Int8 injured; Int8 nice; Int8 wild; Int8 honest; Int32 value; Int8 experience; Int8 stamina; Int8 winging; Int8 goalie; Int8 defending; Int8 leading; Int8 playmaking; Int8 scoring; Int8 passing; Int8 setting; Int8 speciality; Int8 namelen; UInt32 transfer; struct changes changes; }; struct positions { Int16 v[20]; }; struct positionWeight { Int8 form; Int8 experience; Int8 stamina; Int8 goalie; Int8 playmaking; Int8 passing; Int8 winging; Int8 defending; Int8 scoring; Int8 setting; Int8 leading; }; struct preferences { UInt16 currency; UInt8 isalarm; UInt8 positionPage; UInt16 selectedScreen; UInt16 selectedPlayer; UInt16 selectedEditPage; UInt16 selectedPositionPage; UInt16 prefsPlayerScreen; UInt16 prefsPrevScreen; UInt16 prefsAttitude; struct positionWeight w[20]; UInt8 selectedArena; Int8 arenaPessimistic; Int8 arenaNormal; Int8 arenaOptimistic; Int8 arenaTerraces; Int8 arenaBasic; Int8 arenaRoof; Int8 arenaVIP; UInt32 arenaHasTerraces; UInt32 arenaHasBasic; UInt32 arenaHasRoof; UInt32 arenaHasVIP; UInt32 supporters; UInt16 orderby; }; /* Global Vars */ extern FormPtr gpForm; extern FormPtr bgForm; extern Int32 fans; extern struct player *players; extern struct player *editedPlayer; extern UInt8 NofPlayers; extern Char **playerNameList; extern struct preferences prefs; extern Boolean firstStart; extern Boolean showWelcome; extern BitmapType *starBitmap; /* Functions */ Boolean ArenaScreenEHandler(EventPtr); Boolean PlayerScreenEHandler(EventPtr); Boolean PlayerEditEHandler(EventPtr); Boolean PositionScreenEHandler(EventPtr); Boolean PlayerPrefsEHandler(EventPtr); Boolean ArenaPrefsEHandler(EventPtr); Boolean VariousPrefsEHandler(EventPtr); Boolean ChangesScreenEHandler(EventPtr); Boolean TransferScreenEHandler(EventPtr); Boolean switchScreen(UInt16); struct player *NewPlayer(); struct player *getPlayer(Int16); void addPlayer(struct player *); void deletePlayer(struct player **); void removePlayer(UInt16); void EditPlayer(Int8); void sortPlayers(); Err OpenPlayerDatabase(); void saveDB(); void DbSetPlayer(UInt16 p); UInt16 whichPositionPage(); Char *getStrength(Int8); Char *getCurrency(); Char *getInCurrency(Int32, Boolean); Int32 valueInCurrency(Int32); Int32 currencyToKroner(Int32); void *getOPtr(UInt16); void updatePlayerList(); void fillField(Char *, UInt16, Int8); void fillValue(Char *, UInt16, Int16); void SetEditValue(UInt16, UInt16, Int8); Char *allocName(Char *); void setPositionWeight(UInt16, struct positionWeight); Int8 posID(UInt16); void SetNextAlarm(); void beepwait();