Package net.sf.colossus.appmain
Class Start
java.lang.Object
net.sf.colossus.appmain.Start
Class Start contains code to start the different types of games.
- Author:
- David Ripton, Clemens Katzer (rewritten big parts of the main() method)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CmdLine
private static final Logger
private final Options
private final WhatNextManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
commandLineProcessing
(String[] args) Prepare the "Opts" object to parse all options from command line.static void
private void
runGetPlayersDialogAndWait
(Options options) Bring up the GetPlayers dialog, and then wait until is has set startObject to the next action to do and notified us to continue.private void
void
setInitialAction
(Options serverOptions, Options netclientOptions) Based on command line options -c, -w, possibly -g, set startObject to the right "whatToDoNext" action and set in startOptions the related values.private void
Do the setup of the various Options objects (server, netclient), some more preparations, and then it stays in the loop which - waits for user input what to do next - initiates that action and waits until it completes (or if canceled, like closing the network client dialog, bring up back the main (=GetPlayers) dialog, or if user requests Quit, exit the loop; and when it exited the loop control will return back to main() and the JVM should terminate sooner or later ;-)private boolean
setupOptionsFromCommandLine
(CmdLine cl, Options startOptions, Options options) private boolean
startNetClient
(Options startOptions) private static void
Print a usage string to stdout.
-
Field Details
-
LOGGER
-
cmdLine
-
whatNextManager
-
startOptions
-
-
Constructor Details
-
Start
To create the one "Start" object which handles initiates the "whatToDoNext" action according to what the user wants. Brings up one of the dialogs, or starts a Game, a Network client or a Web Client.
-
-
Method Details
-
getStartOptions
-
getWhatNextManager
-
getWhatToDoNext
-
usage
Print a usage string to stdout. (*Not* to the logfile, where casual users will miss it.) -
commandLineProcessing
Prepare the "Opts" object to parse all options from command line. As result, creates/sets the instance variable CmdLine object "cmdLine" from which one can then query which options were set, and their value if they require one.- Parameters:
args
- The String-Array given to main()
-
setInitialAction
Based on command line options -c, -w, possibly -g, set startObject to the right "whatToDoNext" action and set in startOptions the related values. Expects that server (cf) options are already loaded. -
runGetPlayersDialogAndWait
Bring up the GetPlayers dialog, and then wait until is has set startObject to the next action to do and notified us to continue.- Parameters:
options
- The "server side" main options Object which holds the information what kind of game to play next (variant, which players) and the "Game options" for the to-be-started game, like unlimitedMulligans, viewmode, balancedTowers, ...)
-
setupOptionsFromCommandLine
-
setupAndLoop
private void setupAndLoop()Do the setup of the various Options objects (server, netclient), some more preparations, and then it stays in the loop which - waits for user input what to do next - initiates that action and waits until it completes (or if canceled, like closing the network client dialog, bring up back the main (=GetPlayers) dialog, or if user requests Quit, exit the loop; and when it exited the loop control will return back to main() and the JVM should terminate sooner or later ;-) -
runNetClientDialogAndWait
private void runNetClientDialogAndWait() -
startNetClient
-
main
-