Generated from report.c with ROBODoc v3.2.2 on Sun Aug 27 19:47:35 2000

TABLE OF CONTENTS

  1. GalaxyNG/Report
  2. GalaxyNG/reportGMBombings
  3. GalaxyNG/reportHall
  4. GalaxyNG/yourPlanetsForecast
  5. Report/BformatInteger
  6. Report/GformatInteger
  7. Report/GreportFleets
  8. Report/GreportGroup
  9. Report/GreportPlanet
  10. Report/GreportProduction
  11. Report/GreportShipType
  12. Report/appendToFile
  13. Report/canseeBombing
  14. Report/createDummyGame
  15. Report/createGMReport
  16. Report/createTurnReport
  17. Report/dumpItem
  18. Report/formatBuffer
  19. Report/formatChar
  20. Report/formatFloat
  21. Report/formatInteger
  22. Report/formatLabels
  23. Report/formatPrint
  24. Report/formatReset
  25. Report/formatReturn
  26. Report/formatString
  27. Report/formatStringCenter
  28. Report/formatStringMode
  29. Report/highScoreList
  30. Report/mailGMReport
  31. Report/mailTurnReport
  32. Report/rateNations
  33. Report/report
  34. Report/reportBattles
  35. Report/reportBombings
  36. Report/reportFleets
  37. Report/reportGlobalMessages
  38. Report/reportGroup
  39. Report/reportGroupsSeen
  40. Report/reportIncoming
  41. Report/reportMap
  42. Report/reportMessages
  43. Report/reportMistakes
  44. Report/reportOptions
  45. Report/reportOrders
  46. Report/reportPlanet
  47. Report/reportPlanetsSeen
  48. Report/reportProdTable
  49. Report/reportProduction
  50. Report/reportRoutes
  51. Report/reportShipType
  52. Report/reportShipTypes
  53. Report/reportStatus
  54. Report/reportUnidentifiedPlanets
  55. Report/reportUninhabitedPlanets
  56. Report/reportYourGroups
  57. Report/reportYourPlanets
  58. Report/reportYourShipTypes
  59. Report/saveTurnReport
  60. Report/score
  61. Report/storeLength
  62. Report/tagVisiblePlanets
  63. Report/visibleShipTypes
  64. Report/yourStatusForecast

GalaxyNG/Report

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.    

GalaxyNG/reportGMBombings

NAME
   reportGMBombings --
SYNOPSIS
   void reportGMBombings(game *aGame, fielddef *fields)
FUNCTION
   Report all bombings that took place during the turn.

GalaxyNG/reportHall

NAME
   reportHall -- report hall of fame information.

GalaxyNG/yourPlanetsForecast

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.

Report/BformatInteger

NAME
   BformatInteger --

Report/GformatInteger

NAME
   GformatInteger --

Report/GreportFleets

NAME
   GreportFleets --

Report/GreportGroup

NAME
   GreportGroup --

Report/GreportPlanet

NAME
   GreportPlanet --

Report/GreportProduction

NAME
   GreportProduction --

Report/GreportShipType

NAME
   GreportShipType --

Report/appendToFile

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.

Report/canseeBombing

NAME
   canseeBombing --

Report/createDummyGame

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.

Report/createGMReport

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.

Report/createTurnReport

NAME
   createTurnReport -- create turn report.
FUNCTION
   Creates the turn report, a concatenation of 
   bulletins and the actual turn report.

Report/dumpItem

NAME
   dumpItem --

Report/formatBuffer

NAME
   formatBuffer -- buffer to format lines.
SOURCE
    char            formatBuffer[FORMATBUFFERSIZE];    

Report/formatChar

NAME
   formatChar --

Report/formatFloat

NAME
   formatFloat --

Report/formatInteger

NAME
   formatInteger --

Report/formatLabels

NAME
   formatLabels --

Report/formatPrint

NAME
   formatPrint --

Report/formatReset

NAME
   formatReset --

Report/formatReturn

NAME
   formatReturn --

Report/formatString

NAME
   formatString

Report/formatStringCenter

NAME
   formatStringCenter --

Report/formatStringMode

NAME
   formatStringMode --

Report/highScoreList

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.

Report/mailGMReport

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.

Report/mailTurnReport

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

Report/rateNations

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.

Report/report

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);
    }    

Report/reportBattles

NAME
   reportBattles --

Report/reportBombings

NAME
   reportBombings --

Report/reportFleets

NAME
   reportFleets --

Report/reportGlobalMessages

NAME
   reportGlobalMessages --

Report/reportGroup

NAME
   reportGroup --

Report/reportGroupsSeen

NAME
   reportGroupsSeen --

Report/reportIncoming

NAME
   reportIncoming --

Report/reportMap

NAME
   reportMap --

Report/reportMessages

NAME
   reportMessages --

Report/reportMistakes

NAME
   reportMistakes --

Report/reportOptions

NAME
   reportOptions --

Report/reportOrders

NAME
   reportOrders --

Report/reportPlanet

NAME
   reportPlanet --

Report/reportPlanetsSeen

NAME
   reportPlanetsSeen --

Report/reportProdTable

NAME
   reportProdTable --

Report/reportProduction

NAME
   reportProduction --

Report/reportRoutes

NAME
   reportRoutes --

Report/reportShipType

NAME
   reportShipType --

Report/reportShipTypes

NAME
   reportShipTypes --

Report/reportStatus

NAME
   reportStatus --

Report/reportUnidentifiedPlanets

NAME
   reportUnidentifiedPlanets --

Report/reportUninhabitedPlanets

NAME
   reportUninhabitedPlanets --

Report/reportYourGroups

NAME
   reportYourGroups --

Report/reportYourPlanets

NAME
   reportYourPlanets --

Report/reportYourShipTypes

NAME
   reportYourShipTypes --

Report/saveTurnReport

NAME
   saveTurnReport --
FUNCTION
   Create and save a turn report in report/<game name>/

Report/score

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

Report/storeLength

NAME
   storeLength --

Report/tagVisiblePlanets

NAME
   tagVisiblePlanets

Report/visibleShipTypes

NAME
   visibleShipTypes --

Report/yourStatusForecast

NAME
   yourStatusForecast