Generated from report.c with ROBODoc v3.2.2 on Sun Aug 27 19:47:35 2000
TABLE OF CONTENTS
- GalaxyNG/Report
- GalaxyNG/reportGMBombings
- GalaxyNG/reportHall
- GalaxyNG/yourPlanetsForecast
- Report/BformatInteger
- Report/GformatInteger
- Report/GreportFleets
- Report/GreportGroup
- Report/GreportPlanet
- Report/GreportProduction
- Report/GreportShipType
- Report/appendToFile
- Report/canseeBombing
- Report/createDummyGame
- Report/createGMReport
- Report/createTurnReport
- Report/dumpItem
- Report/formatBuffer
- Report/formatChar
- Report/formatFloat
- Report/formatInteger
- Report/formatLabels
- Report/formatPrint
- Report/formatReset
- Report/formatReturn
- Report/formatString
- Report/formatStringCenter
- Report/formatStringMode
- Report/highScoreList
- Report/mailGMReport
- Report/mailTurnReport
- Report/rateNations
- Report/report
- Report/reportBattles
- Report/reportBombings
- Report/reportFleets
- Report/reportGlobalMessages
- Report/reportGroup
- Report/reportGroupsSeen
- Report/reportIncoming
- Report/reportMap
- Report/reportMessages
- Report/reportMistakes
- Report/reportOptions
- Report/reportOrders
- Report/reportPlanet
- Report/reportPlanetsSeen
- Report/reportProdTable
- Report/reportProduction
- Report/reportRoutes
- Report/reportShipType
- Report/reportShipTypes
- Report/reportStatus
- Report/reportUnidentifiedPlanets
- Report/reportUninhabitedPlanets
- Report/reportYourGroups
- Report/reportYourPlanets
- Report/reportYourShipTypes
- Report/saveTurnReport
- Report/score
- Report/storeLength
- Report/tagVisiblePlanets
- Report/visibleShipTypes
- Report/yourStatusForecast
NAME
Report -- functions to create the turn report.
PURPOSE
A collection of functions to create the turn reports.
There a many confusingly named functions, but the function
that creates the actual turn report is report().
The turn report can be formatted in two different formats
(1) plain galaxy
(2) Galaxy Plus (The russian variation of galaxy)
In addition to this there are functions to create the turn
report for the GM and functions to create the highscore list.
The turn report is a collection of tables plus an ASCII map
of the galaxy.
Each table has a heading. The tables consists of a number
of rows. Each row consists of a number of fields.
The formatting routines allow fields to be aligned across
the rows. This is done by a two pass process. In the first
pass, nothing is printed but the maximum width of the field
in all rows is determined. In the second pass this information
is used to properly print the field.
NAME
reportGMBombings --
SYNOPSIS
void reportGMBombings(game *aGame, fielddef *fields)
FUNCTION
Report all bombings that took place during the turn.
NAME
reportHall -- report hall of fame information.
NAME
yourPlanetsForecast -- planet forecast for next turn.
FUNCTION
This is used by the forecaster (orders checker)
to predict the situation
of the planets the next turn.
NAME
BformatInteger --
NAME
GformatInteger --
NAME
GreportFleets --
NAME
GreportGroup --
NAME
GreportPlanet --
NAME
GreportProduction --
NAME
GreportShipType --
NAME
appendToFile -- append contents of one file to another.
SYNOPSIS
void appendToFile(char *fileName, FILE *report)
FUNCTION
Append the content of another file to a file.
If the file does not exist, just skip it.
NAME
canseeBombing --
NAME
createDummyGame -- create a dummy game.
SYNOPSIS
game *createDummyGame(void)
FUNCTION
Create a dummy game in case a real game could not be loaded.
Then use it to read the .galaxyngrc file.
NAME
createGMReport -- create status report for GM
SYNOPSIS
void createGMReport(game *aGame, char *gameName, FILE *gmreport)
FUNCTION
Creates the status report for the GM. Currently consists of
the log file and the high score list.
NAME
createTurnReport -- create turn report.
FUNCTION
Creates the turn report, a concatenation of
bulletins and the actual turn report.
NAME
dumpItem --
NAME
formatBuffer -- buffer to format lines.
SOURCE
char formatBuffer[FORMATBUFFERSIZE];
NAME
formatChar --
NAME
formatFloat --
NAME
formatInteger --
NAME
formatLabels --
NAME
formatPrint --
NAME
formatReset --
NAME
formatReturn --
NAME
formatString
NAME
formatStringCenter --
NAME
formatStringMode --
NAME
highScoreList -- create high score list
SYNOPSIS
void highScoreList(game *aGame)
FUNCTION
Creates a file with the high score list for the current turn.
This file is later included into the turn report.
RESULT
High score list under the name notices/<game name>.score
BUGS
Should check for errors and write them to the log file.
NAME
mailGMReport -- mail the GM a status report.
SYNOPSIS
void mailGMReport(game *aGame, char *gameName)
FUNCTION
Email the GM a status report about a run of a turn.
SEE ALSO
CMD_run()
NOTES
Does log any errors.
Does not return an error status.
NAME
mailTurnReport -- create and mail a turn report
FUNCTION
Create and mail a turn report to a player.
0 -- all OK
>0 -- something went wrong
NAME
rateNations -- give nations a ranking number.
SYNOPSIS
void rateNations(player *playerList)
NOTES
If any nation manages to get more that 1E20 effective
industry this function will fail.
NAME
report -- create a basic turn report.
SYNOPSIS
report(game *aGame, player *P, FILE *report)
FUNCTION
Extracts information from the game structure and formats
it in human readable format.
Two kind of reports are supported, plain galaxy and
galaxy plus.
SOURCE
void
report(game *aGame, player *P, FILE * report)
{
struct fielddef fields;
pdebug(DFULL, "report\n");
fields.destination = report;
if (P->flags & F_GPLUS) {
fprintf(fields.destination,
" %s Report for Galaxy PLUS %c%s Turn %d\n",
P->name, toupper((aGame->name)[0]), aGame->name + 1, aGame->turn);
fprintf(fields.destination,
" Galaxy PLUS version 1.0-NG-GPLUS-Emulator\n\n");
fprintf(fields.destination,
" Size: %.0f Planets: %d Players: %d\n\n",
2 * aGame->galaxysize, numberOfElements(aGame->planets),
numberOfElements(aGame->players));
}
else {
fprintf(fields.destination,
"\t%s\n\n", vcid);
fprintf(fields.destination,
"\t\tGalaxy Game %c%s Turn %d Report for %s\n\n",
toupper((aGame->name)[0]), aGame->name + 1, aGame->turn, P->name);
}
if (P->pswdstate eq 1) {
fprintf(fields.destination,
"\n\nPassword for player %s set to %s\n", P->name, P->pswd);
fprintf(fields.destination, "First line of your orders should now be:\n");
fprintf(fields.destination, "#GALAXY %s %s %s\n",
aGame->name, P->name, P->pswd);
}
reportGlobalMessages(aGame->messages, &fields);
reportMessages(P, &fields);
reportOptions(P, &fields);
reportOrders(P, &fields);
reportMistakes(P, &fields);
nationStatus(aGame);
reportStatus(aGame->players, P, &fields);
reportYourShipTypes(P, &fields);
reportShipTypes(aGame, P, &fields);
reportBattles(aGame, P, &fields);
reportBombings(aGame, P, &fields);
reportMap(aGame, P, &fields);
reportIncoming(aGame, P, &fields);
reportYourPlanets(aGame->planets, P, &fields);
reportProdTable(aGame->planets, P, &fields);
reportRoutes(aGame->planets, P, &fields);
reportPlanetsSeen(aGame, P, &fields);
reportUnidentifiedPlanets(aGame->planets, P, &fields);
reportUninhabitedPlanets(aGame->planets, P, &fields);
reportYourGroups(aGame->planets, P, &fields);
if (P->flags & F_GPLUS) {
GreportFleets(aGame->planets, P, &fields);
}
else {
reportFleets(P, &fields);
}
reportGroupsSeen(aGame, P, &fields);
}
NAME
reportBattles --
NAME
reportBombings --
NAME
reportFleets --
NAME
reportGlobalMessages --
NAME
reportGroup --
NAME
reportGroupsSeen --
NAME
reportIncoming --
NAME
reportMap --
NAME
reportMessages --
NAME
reportMistakes --
NAME
reportOptions --
NAME
reportOrders --
NAME
reportPlanet --
NAME
reportPlanetsSeen --
NAME
reportProdTable --
NAME
reportProduction --
NAME
reportRoutes --
NAME
reportShipType --
NAME
reportShipTypes --
NAME
reportStatus --
NAME
reportUnidentifiedPlanets --
NAME
reportUninhabitedPlanets --
NAME
reportYourGroups --
NAME
reportYourPlanets --
NAME
reportYourShipTypes --
NAME
saveTurnReport --
FUNCTION
Create and save a turn report in report/<game name>/
NAME
score -- create high score list.
SYNOPSIS
void score(game *g1, game *g2, int html, FILE *dest)
FUNCTION
Compute the high score list based on the differences in
the economic status of the nations between two turns.
INPUTS
g1 -- previous turn
g2 -- this turn
html -- do we want html output?
dest -- file to write the results to
NAME
storeLength --
NAME
tagVisiblePlanets
NAME
visibleShipTypes --
NAME
yourStatusForecast