Complete.Org: Mailing Lists: Archives: freeciv-dev: June 1999:
[Freeciv-Dev] Front end/back end conversion
Home

[Freeciv-Dev] Front end/back end conversion

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv developers mailing list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Front end/back end conversion
From: Andy Black <ablack@xxxxxxxxxxxxxx>
Date: Thu, 17 Jun 1999 18:33:13 -0600

Hi

I wish to propose how to split the Freeciv code betwene front-end and
back-end if such a split was going to happen. I would sugest puting the
GUI, disk i/o, raw network i/o, and inital/comand line options into the
front end because hardware interactions are platform specific to some
degree.  The back-end code should be the code that makes the game tick
(algorithms and flaten/unflaten code).  The reason I placed the i/o section
into the front-end is because different Operating Systems have different
ways to handle disk and network conections.  The reason I placed the comand
line options in the front-end is because some operating systems (the Mac OS
for instance) don't have a comand line interface & the ability to use the
switches that are so effective in other environments.

Idealy, the main should look something like one of the folowing

LINUX/DOS
int main(int argc, char * args)
{
        int error
        error=init(argc, args);
        if error!=0
                exit(1);
        error=game_loop();
        if error!=0
                exit(1);
        cleanup();
}

or

MAC
int main(void)
{
        OSErr error
        error=init();
        if error!=0
                exit(1);
        error=game_loop();
        if error!=0
                exit(1);
        cleanup();
}

I suspect the WIN32 version would be similar to the mac version, but I
don't know.

Andy



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Front end/back end conversion, Andy Black <=