| S  | D  | N  :     SLASHDOT  ·  FRESHMEAT  ·  THEMES.ORG   
 OSDN - Open Source Development Network

 Source Forge

PalmPGN Links

Project Page    >
Main Page    >
Screenshots    >
Relelase Schedule    >

FAQ    >
Public Forums    >
Announcement List    >

Downloads    >
Documentation    >

Design Scenarios    >
Requirements    >
Interaction Diagrams and Use Cases    <
Class Diagram    >

Credits    >
About the GPL    >


PalmPGN - Use Cases & Interaction Diagrams


These are use cases, describing the way that PalmPGN will act to fulfill the requirements that have been identified. Beside each use case name are the requirements section met by that use case. Some of the use cases listed toward the bottom of this page are shared by other use cases, and don't directly fulfill requirements.

Below each use case is an interaction diagram that shows a list of objects and how they work together to implement the use case. Messages are sent between objects as they interact, and in some cases, values are returned to the caller.

This is my own format for interaction diagrams, attempting to be a text version of UML. It's not too pretty, but it helped clear things up in my mind as I was using it, and it didn't get in the way like Visio or another such tool might have. I'd like to pretty this up (perhaps with GIFs and HTML tables and such), but I'd rather be coding. (Or playing chess, even.)

Symbols

. is an object instance of the class named in the column above
= is a call of a method on that object (named on the same line)
# in first column marks 'c' for call of use case, method, etc., 'r'
	for return from that method (should be multiple 'r' for each 'c').
	First 'r' should be successful return, if appropriate, causing
	most frequent code path to collect at top of interaction diagram.
s is the start of the use case
e is the end/exit of the use case

Use Cases

  • Start app (1.1, 1.2, 1.3, 3.1, 3.2)

    User starts app.

    If app has not been started before: call 'create new db' with name of "Chess Games"; set "Chess Games" database to be current; call 'create new game'; call 'display board'.

    If app has been started before: set the current db to the last used db; if last game had mods, call 'load a game' with those mods, else call 'load a game' with original game from db; set current move to last viewed move; call 'display board'.

    1. O/S
    2. PilotMain (free standing function)
    3. Controller
    4. AppSettings
    5. DBList
    6. GameDB
    7. Game
    8. BoardView
    	A   B   C   D   E   F   G   H
    	s-->. (fn: PilotMain)
    	    .-->. (fn: ctor)
    	        .-->. (fn: ctor)
    	        .------>. (fn: ctor)
    	    .-->. (fn: initApp)
    1c			.-->. (fn: getLastViewedDB)
    1r			.<--. (ret: valid DB name (if app has been started before))
    			.------>. (fn: loadGameDB; param: db descriptor)
    			.<------. (ret: GameDB)
    			.---------->. (fn: getCurrentGame)
    			.<----------. (ret: current-game descriptor)
    			.= (fn: loadGame; param: current game descriptor, curDB)
    			.< (ret: Game object)
    			.-->. (fn: wasLastGameModified)
    			.<--. (ret: true/false)
    true		.-->. (fn: getModMoveList)
    true		.-------------->. (fn: setMovesAfterCurrent; param: modified move list)
    			.-->. (fn: getLastViewedPly)
    			.<--. (ret: PlyDescriptor)
    			.-------------->. (fn: gotoPly; param: last-viewed-ply descriptor)
    			.------------------>. (fn: displayBoard; param: current game)
    		.<--. (ret: success)
    	    .-->. (fn: runApp (main loop of application))
    		.<--. (action: app exited by user)
    	e<--. (action: app closes down)
    
    1r	        .<--. (ret: null, (if app has not been started before))
    			.------>. (fn: createGameDB; param: "Chess Games" db name)
    			.<------. (ret: GameDB object)
    			.= (fn: createNewGame)
    		.<--. (ret: success)
    	    .-->. (fn: runApp (main loop of application))
    		.<--. (action: app exited by user)
    	e<--. (action: app closes down)
    
  • Initialize game (2.1)

    User selects 'initialize game' option; call 'create new game'; call 'display board'.

    1. O/S
    2. Controller
    3. BoardView
    	A   B   C
    	s-->. (msg: initialize game)
    		.= (fn: createNewGame)
    		.-->. (fn: displayBoard; param: new game)
    	e<--.
    
  • Set current game db (2.2)

    User selects 'set current game db' option; call 'select game db' to get new db; set selected db to be current; call 'load a game' with the current game from this database; call 'display board'.

    1. O/S
    2. Controller
    3. BoardView
    4. DBList
    5. GameDB
    	A   B   C   D   E
    	s-->. (msg: set current game db)
    1c		.-->. (fn: selectGameDB)
    1r		.<--. (ret: db descriptor)
    		.------>. (fn: loadGameDB; param: db descriptor)
    		.<------. (ret: GameDB)
    		.---------->. (fn: getCurrentGame)
    		.<----------. (ret: current-game descriptor)
    		.= (fn: loadGame; param: current game descriptor, selected GameDB)
    		.< (ret: Game object)
    		.-->. (fn: displayBoard; param: current game)
    	e<--.
    
    1r		.<--. (ret: cancel)
    	e<--.
    
  • Select game/position (2.3)

    User selects 'load game'; display list of games in current db; user selects a game from list; call 'load a game' with selected game; call 'display board'.

    1. O/S
    2. Controller
    3. GameListDisplay
    4. BoardView
    A   B   C   D
    	s-->. (msg: load game)
    1c		.-->. (fn: displayGameList; param: curDB)
    1r		.<--. (ret: game selected by user)
    		.= (fn: loadGame; param: selected GameDescriptor, current GameDB)
    		.< (ret: Game object)
    		.------>. (fn: displayBoard; param: loaded game)
    	e<--.
    
    1r		.<--. (ret: null (cancelled by user))
    	e<--.
    
  • Select next/previous game/position (2.5)

    User selects 'load next game' or 'load previous game' (note: these options should not be enabled if a next or previous game is not available); call 'load a game' with next/previous game from current db; set current game in current db to this game; call 'display board'.

    1. O/S
    2. Controller
    3. GameDB
    4. BoardView
    	A   B   C   D
    	s-->. (msg: load next/prev game) (precondition: db not at last/first game)
    		.-->. (fn: getNextGame/getPreviousGame)
    		.<--. (ret: selected game descriptor )
    		.= (fn: loadGame; param: selected GameDescriptor, current GameDB)
    		.< (ret: Game object)
    		.------>. (fn: displayBoard; param: loaded game)
    	e<--.
    
  • Setup position (2.6.1)

    User selects 'setup board'; enter setup mode; set setup board to current position from current game; call 'display board'.

    1. O/S
    2. Controller
    3. Game
    4. SetupView
    	A   B   C   D
    	s-->. (msg: setup board)
    		.-->. (fn: getPosition)
    		.<--. (ret: current Position)
    		.------>. (fn: displayBoard; param: current Position)
    	e<--.
    
  • Clear board (setup) (2.6.2)

    User selects 'clear board'; remove all pieces from board; place king of each color on respective starting squares, (i.e. e1 & e8); call 'display board'.

    1. O/S
    2. Controller
    3. Game
    4. SetupView
    	A   B   C   D
    	s-->. (msg: clear board)
    		.-->. (fn: setupClearBoard)
    		.------>. (fn: displayBoard; param: current position)
    	e<--.
    
  • Set initial position (setup) (2.6.3)

    User selects 'set initial position'; remove all pieces from board; place each piece in its starting location; call 'display board'.

    1. O/S
    2. Controller
    3. Game
    4. SetupView
    	A   B   C   D
    	s-->. (msg: set inital position)
    		.-->. (fn: setupSetInitialPosition)
    		.------>. (fn: displayBoard; param: current position)
    	e<--.
    
  • Add pieces (setup) (2.6.4)

    User clicks on piece icon, then clicks on board square, or clicks on piece icon and drags to square; place that piece on that square; call 'display board'.

    1. O/S
    2. Controller
    3. Game
    4. SetupView
    	A   B   C   D
    	s-->. (msg: piece dragged onto board)
    		.-->. (fn: setupSetPiece)
    		.------>. (fn: displayBoard; param: current position)
    	e<--.
    
  • Remove pieces (setup) (2.6.6)

    User clicks on piece on board and drags piece off of board; remove that piece from the board; call 'display board'.

    1. O/S
    2. Controller
    3. Game
    4. SetupView
    	A   B   C   D
    	s-->. (msg: piece dragged off of board)
    		.-->. (fn: setupRemovePiece)
    		.------>. (fn: displayBoard; param: current position)
    	e<--.
    
  • Move pieces (setup) (2.6.5)

    User clicks on piece on board and clicks on new square, or clicks on piece and drags piece to new square; if a piece currently sits on that square, remove that piece from the board; remove the new piece from its old square and place it on the new square; call 'display board'.

    1. O/S
    2. Controller
    3. Game
    4. SetupView
    	A   B   C   D
    	s-->. (msg: piece dragged from square to square)
    		.-->. (fn: setupSetPiece)
    		.-->. (fn: setupRemovePiece)
    		.------>. (fn: displayBoard; param: current position)
    	e<--.
    
  • Set game options (setup) (2.6.7.*)

    User selects 'game options'; display game options dialog; user chooses options in dialog, and accepts or discards changes; store user selections for use after setup mode is completed.

    1. O/S
    2. Controller
    3. Game
    4. SetupView
    	A   B   C   D
    	s-->. (msg: game options)
    		.-->. (fn: getGameOptions)
    		.------>. (fn: editGameOptions)
    		.-->. (fn: setGameOptions)
    	e<--.
    
  • Complete setup (setup) (2.6.8)

    User selects 'complete setup; if side to move has no valid moves, or already has opponents king in check, inform user of this situation, and exit use case; otherwise, call 'load a game' with game position entered in setup mode; set game options per options selected by user in options dialog; call 'display board'.

    1. O/S
    2. Controller
    3. Game
    4. SetupView
    5. BoardView
    	A   B   C   D   E
    	s-->. (msg: complete setup)
    		.-->. (fn: completeSetup)
    		.------>. (fn: close)
    		.---------->. (fn: displayBoard; param: current game)
    	e<--.
    
  • Scroll through game (3.3, 3.4, 3.5)

    User selects 'forward'; if there are moves past the current ply, move forward one ply in move list, applying change to board; call 'display board'.

    User selects 'backward;; if there are moves before the current ply, move backward one ply in move list, applying change to board; call 'display board'.

    User selects 'first'; move to initial position (preserving move list); call 'display board'.

    User selects 'last'; move to last ply in move list (applying each ply to board; call 'display board'.

    1. O/S
    2. Controller
    3. Game
    4. BoardView
    	A   B   C   D
    	s-->. (msg: forward) (precondition: game not at last position)
    		.-->. (fn: forward)
    		.------>. (fn: displayBoard; param: current game)
    	e<--.
    
    	s-->. (msg: backward) (precondition: game not at first position)
    		.-->. (fn: backward)
    		.------>. (fn: displayBoard; param: current game)
    	e<--.
    
    	s-->. (msg: first) (precondition: game not at first position)
    		.-->. (fn: first)
    		.------>. (fn: displayBoard; param: current game)
    	e<--.
    
    	s-->. (msg: last) (precondition: game not at last position)
    		.-->. (fn: last)
    		.------>. (fn: displayBoard; param: current game)
    	e<--.
    
  • Display solution (3.6)

    User selects 'display solution'; if game position wasn't loaded or if it doesn't contain a solution, exit use case; display solution text in dialog; user closes dialog.

    1. O/S
    2. Controller
    3. Game
    4. BoardView
    	A   B   C   D
    	s-->. (msg: display solution) (precondition: position contains solution)
    		.-->. (fn: getSolution)
    		.<--. (ret: solution text)
    		.------>. (fn: displayTextMsg; param: solution text)
    	e<--.
    
  • Display annotation (3.7)

    User selects 'display annotation'; if ply contains annotation, display annotation in text box; user closes text box. (Annotation symbols attached to current ply have already been displayed with current ply's PGN.)

    1. O/S
    2. Controller
    3. Game
    4. BoardView
    	A   B   C   D
    	s-->. (msg: display annotation) (precondition: ply contains annotation)
    		.-->. (fn: getTextAnnotation)
    		.<--. (ret: annotation text)
    		.------>. (fn: displayTextMsg; param: annotation text)
    	e<--.
    
  • Enter new moves (4.1.1, 4.1.2, 4.2)

    User clicks on piece, then clicks on destination square, or user clicks on piece and drags to destination square; if move is not valid, exit use case; if current ply is not at end of list, remove plies after current ply, placing them in undo slot (removing previous contents of undo slot); add new move to end of move list; add new move to undo slot (with removed list of plies, if present); clear redo slot; apply to board; call 'display board'.

    1. O/S
    2. Controller
    3. Game
    4. BoardView
    	A   B   C   D
    	s-->. (msg: move entered)
    1c		.-->. (fn: isMoveLegal)
    1r		.<--. (ret: true)
    		.= (fn: clearRedo)
    		.-->. (fn: getMovesAfterCurrent)
    		.<--. (ret: move list, or null)
    		.= (fn: setUndo; param: current move, move list (or null))
    		.-->. (fn: addMove)
    		.= (expr: increment modified count)
    		.------>. (fn: displayBoard; param: current game)
    	e<--.
    
    1r		.<--. (ret: false)
    	e<--.
    
  • Annotate moves (4.3.1, 4.3.2)

    User selects 'annotate move'; display text box to collect annotation; user enters text, and closes text box; annotation is added to game score for current ply.

    User selects 'add symbol'; display list of symbols; user selects symbol; symbol is added to game score for current ply; call 'display board'.

    1. O/S
    2. Controller
    3. BoardView
    4. Game
    	A   B   C   D   E
    	s-->. (msg: annotate move)
    		.-->. (fn: getTextAnnotation)
    		.------>. (fn: setTextAnnotation; param: text)
    		.-->. (fn: displayBoard; param: current game)
    	e<--.
    
    	s-->. (msg: add symbol)
    		.-->. (fn: getSymbol)
    		.------>. (fn: setSymbol; param: symbol)
    		.-->. (fn: displayBoard; param: current game)
    	e<--.
    
  • Undo/Redo single move (4.1.3)

    User selects 'undo', (if undo slot is empty, option is not available); remove move from undo slot from move list; if undo slot also contains ply list, place ply list back into move list; move contents of undo slot to redo slot; call 'display board'.

    User selects 'redo', (if redo slot is empty, options is not available); reapply move from redo slot; move contents of redo slot to undo slot, including ply list, if any; call 'display board'.

    1. O/S
    2. Controller
    3. Game
    4. BoardView
    	A   B   C   D
    	s-->. (msg: undo) (precondition: undoSlot is not empty)
    		.-->. (fn: gotoPly; param: ply shown in undo slot)
    		.-->. (fn: getMovesAfterCurrent)
    		.-->. (fn: setMovesAfterCurrent; param: move list in undo slot)
    		.= (fn: setRedo; param: move from undo, move list retrieved from game)
    		.= (fn: clearUndo)
    		.= (expr: decrement modified count)
    		.------>. (fn: displayBoard; param: current game)
    	e<--.
    
    	s-->. (msg: redo) (precondition: redoSlot is not empty)
    		.-->. (fn: getMovesAfterCurrent)
    		.= (fn: setUndo; param: move from redo, move list retrieved from game)
    		.-->. (fn: addMove; param: move from redo slot)
    		.= (fn: clearRedo)
    		.= (expr: increment modified count)
    		.------>. (fn: displayBoard; param: current game)
    	e<--.
    
  • Revert to original game (4.1.4)

    Call 'load a game' with current game from current db; call 'display board'.

    1. O/S
    2. Controller
    3. BoardView
    	A   B   C
    	s-->. (msg: revert) (precondition: original game exists to revert to)
    		.= (fn: loadGame; param: game descriptor from current game, current GameDB)
    		.< (ret: Game object)
    		.= (expr: set modified to zero)
    		.-->. (fn: displayBoard; param: current game)
    	e<--.
    
  • Enter game data (4.4, 5.2.2)

    User selects 'game data'; display dialog with game data fields; user enters or modifies game data and selects 'ok' (or 'cancel'; selecting cancel exits this user case);

    If player names were modified:

    • If user manually changed name of game, prompt user to okay name change.
    • If name wasn't manually changed, or if user okay's change, change name of game to reflect new player names.

    Game data is stored with game, to be saved with game.

    1. O/S
    2. Controller
    3. BoardView
    4. Game
    	A   B   C   D
    	s-->. (msg: game data)
    		.------>. (fn: getGameData)
    		.<------. (ret: GameData object)
    		.-->. (fn: editGameData; param: GameData object)
    		.------>. (fn: setGameData; param: GameData object)
    	e<--.
    
  • Work with databases (6.1.1, 6.1.2, 6.1.3, 7.6)

    User selects 'list databases'; display list of databases; user selects a database, then:

    • User selects 'create new database'; call 'create new db'; refresh list.
    • User selects 'rename database'; prompt user for a new name; user enters name, then selects 'ok' (or 'cancel'; selecting cancel exits this user case); change name of database; refresh list.
    • User selects 'delete database'; if database is empty, delete it; if not, display number of games in database, and prompt user to delete; user selects 'yes' (or 'no'; selecting no exits this user case); delete the database; refresh list.
    • User selects 'beam database'; beam .pdb file to other Palm unit; return to list.
    • User selects 'close'; list is closed, returning user to game screen.

    1. O/S
    2. Controller
    3. GameDBListDisplay
    4. DBList
    5. BeamManager
    6. BoardView
    	A   B   C   D   E   F
    	s-->. (msg: list databases)
    		.-->. (fn: displayGameList; param: curDB)
    	.-->. (msg: create new database)
    		.-->. (fn: getNewDBName)
    		.------>. (fn: createGameDB; param: new name)
    		.<------. (ret: GameDB object)
    		.-->. (fn: refreshList)
    	.-->. (msg: rename database)
    		.-->. (fn: getSelectedDB)
    		.-->. (fn: getNewDBName)
    		.------>. (fn: renameDB; param: old name, new name)
    		.-->. (fn: refreshList)
    	.-->. (msg: delete database)
    		.-->. (fn: getSelectedDB)
    		.-->. (fn: confirmDBDelete)
    		.------>. (fn: deleteDB; param: selected DB)
    		.-->. (fn: refreshList)
    	.-->. (msg: beam database)
    		.-->. (fn: getSelectedDB)
    		.---------->. (fn: beamDB; param: selected DB)
    	.-->. (msg: close)
    		.-->. (msg: close)
    		.-------------->. (fn: displayBoard; param: current game)
    	e<--.
    
  • Work with database games (6.2.1, 6.2.2, 6.2.3, 6.2.4, 7.1, 7.2, 7.5)

    User selects 'list games'; display list of games in current database; user selects a game, then:

    • User selects 'copy game'; call 'get destination db' for db; if user cancelled, exit use case; create new game from selected game and db; refresh list.
    • User selects 'move game'; call 'get destination db' for db; if user cancelled, exit use case; create new game from selected game and db name; erase previous game; refresh list.
    • User selects 'rename game'; prompt user for a new name; user enters name, then selects 'ok' (or 'cancel'; selecting cancel exits this user case); change name of game; refresh list.
    • User selects 'delete game'; confirm deletion, ('cancel' exits use case); delete game; refresh list.
    • User selects 'export game to memo'; convert game to PGN text; create a new memo file with first line equal to game name, blank second line, and remainder of file with PGN tags, game score and annotations.
    • User selects 'email game'; prompt user for destination address; convert game to PGN text; connect to PalmPilot email program, and send PGN to that address.
    • User selects 'beam game'; prompt user for format of send, 'PGN' or 'PalmPGN'; if PGN, convert selected game to PGN text; beam data of proper type to other Palm unit.
    • User selects 'close': list is closed, returning user to game screen.

    1. O/S
    2. Controller
    3. GameListDisplay
    4. GameDB
    5. Game
    6. BeamManager
    7. BoardView
    	A   B   C   D   E   F   G
    	s-->. (msg: list games)
    		.-->. (fn: displayDBList)
    	.-->. (msg: copy game)
    		.= (fn: getDestinationDB)
    		.-->. (fn: getNewGameName)
    		.= (fn: saveGame; param: game, db descriptor, create)
    		.-->. (fn: refreshList)
    	.-->. (msg: move game)
    		.= (fn: getDestinationDB)
    		.-->. (fn: getNewGameName)
    		.= (fn: saveGame; param: game, db descriptor, create)
    		.------>. (fn: deleteGame; param: old game descriptor)
    		.-->. (fn: refreshList)
    	.-->. (msg: rename game)
    		.-->. (fn: getNewGameName)
    		.------>. (fn: renameGame; param: old name descriptor, new name)
    		.-->. (fn: refreshList)
    	.-->. (msg: delete game)
    		.-->. (fn: confirmGameDelete)
    		.------>. (fn: deleteGame; param: name)
    		.-->. (fn: refreshList)
    	.-->. (msg: export game to memo)
    		.---------->. (fn: convertToPGN)
    		.<----------. (ret: PGN text)
    		.= (fn: exportToMemo; param: PGN text)
    	.-->. (msg: email game)
    		.-->. (fn: getDestEmailAddr)
    		.---------->. (fn: convertToPGN)
    		.<----------. (ret: PGN text)
    		.= (fn: sendViaEmail; param: PGN text, dest addr)
    	.-->. (msg: beam game)
    		.-->. (fn: getBeamFormat)
    		.---------->. (fn: convertToPGN)
    		.<----------. (ret: PGN text)
    		.-------------->. (fn: beamGame; param: data to beam)
    	.-->. (msg: close)
    		.-->. (msg: close)
    		.------------------>. (fn: displayBoard; param: current game)
    	e<--.
    
  • Transfer database to/from desktop (7.3)

    PalmPGN does not internally support transfer of data to/from the desktop. PalmPilots are shipped with tools to allow transfer of Palm databases to/from the desktop, and the user will use those tools to perform this action. PalmPGN will name its Palm databases such that the db name that the user selects will be the name of the file once transferred to the desktop, with a '.pdb' extension.

  • Beam current game to other PalmPilot (7.4)

    User selects 'beam game'; prompt user for format of send, 'PGN' or 'PalmPGN'; if PGN, convert game to PGN text; beam data of proper type to other Palm unit.

    1. O/S
    2. Controller
    3. BoardView
    4. Game
    5. BeamManager
    	A   B   C   D   E
    	s-->. (msg: beam game)
    		.-->. (fn: getPGNBeamFmt)
    		.<--. (ret: true (PGN) or false (PalmPGN))
    true	.------>. (fn: convertToPGN)
    true	.<------. (ret: PGN text)
    		.---------->. (fn: beamGame; param: data to beam)
    		.-->. (fn: displayBoard; param: current game)
    	e<--.
    
  • Convert PGN file to PalmPGN format (8.1)

    User runs desktop Java application to convert PGN to/from PalmPGN .pdb file:

    • User selects 'convert PGN to PalmPGN'; display file open dialog; user selects PGN file; prompt user for PalmPGN filename; convert selected PGN to PalmPGN format, storing it in selected path and name.
    • User selects 'convert PalmPGN to PGN'; display file open dialog; user selects PalmPGN file; prompt user for PGN filename; convert selected PalmPGN to PGN format, storing it in selected path and name.

    User runs command line Java application to convert PGN to/from PalmPGN .pdb file:

    • User runs cmdline app with -PGN flag, PGN filename & PalmPGN filename; convert PalmPGN to PGN format, storing it in path/file specified.
    • User runs cmdline app with -PalmPGN flag, PalmPGN filename & PGN filename; convert PGN to PalmPGN format, storing it in path/file specified.

  • Quit app (9.1, 9.2)

    User chooses to exit app; save current game & db name; if user modified this game, save game score.

    1. O/S
    2. Controller
    3. AppSettings
    4. GameDB
    	A   B   C   D
    	s-->. (msg: quit)
    		.= (fn: saveGame) (precondition: modified count is non-zero)
    		.-->. (fn: saveCurrentGameDescriptor)
    		.-->. (fn: saveCurrentDBDescriptor)
    		.= (expr: exit app)
    	e<--.
    
  • Display board

    Display board diagram for current ply; display PGN for last ply (if last ply was for White) or last two plies (if last ply was for Black); enable/disable load next/previous menu options (as appropriate for current db).

    1. Caller
    2. BoardView
    3. Game
    	A   B   C
    	s-->. (fn: displayBoard; param: Game object)
    		.-->. (fn: getPosition)
    		.= (fn: displayPosition; param: position retrieved from Game)
    		.-->. (fn: getLastPlyPGN)
    		.= (fn: displayPlyPGN; param: PGN retrieved from Game)
    		.-->. (fn: isFirst, isLast)
    		.= (fn: enable/disable First/Next/Prev/Last/etc. options)
    	e<--.
    
  • Create new game (5.2.1)

    Create an empty game in the current database; name it "Unk v Unk n" (where n makes the name unique amongst "Unk v Unk" games); clear this game's move list; set current position to initial position; call 'load a game' with new game; set 'accept modifications' flag, to silently receive and save all modifications to this game.

    1. Caller
    2. Controller
    3. GameDB
    4. Game
    	A   B   C   D
    	s-->. (fn: createNewGame)
    		.------>. (ctor)
    				.= (expr: currentPos = 0, etc.)
    		.------>. (fn: setGameName; param: "Unk v Unk")
    		.-->. (fn: addGameToDB; param: Game object)
    		.= (fn: loadGame; param: new game/current database)
    		.< (ret: Game object)
    	e<--.
    
  • Load a game (2.7, 5.1.1)

    If modifications have been made to current game:

    • If 'prompt for user mods' flag is not set: call 'save game/pos' with current game & db, to overwrite.
    • If 'prompt for user mods' flag is set: prompt user to overwrite original game, create a new game or discard changes; user selects 'overwrite', 'create', 'discard' or 'cancel';
      • If user selected 'overwrite': overwrite game in current db with current game; proceed with remainder of use case.
      • If user selected 'create in current db': call 'get destination db'; if user cancelled, exit use case; create new game in selected db with current game data.
      • If user selected 'create in another db': call 'get destination db'; if user cancelled, exit use case; create game in selected db with current game data.
      • If user selected 'discard': proceed with remainder of use case.
      • If user selected 'cancel': exit use case.

      Load moves or position from game db into move list; set current move to last move (for game) or first move (for position); set 'prompt for user mods' flag.

    1. Caller
    2. Controller
    3. GameDB
    4. Game
    5. BoardView
    	A   B   C   D   E
    	s-->. (fn: loadGame; param: GameDescriptor, GameDB)
    1c		.------>. (fn: isModified)
    1r		.<------. (ret: true)
    2c		.------>. (fn: isPromptForUserMods)
    2r		.<------. (ret: true)
    3c		.---------->. (fn: promptForUserMods)
    3r		.<----------. (ret: overwrite)
    		.= (fn: saveGame; param: current game, db, replace)
    	(skip to 1f, below)
    
    3r		.<----------. (ret: create in current db)
    		.= (fn: getDestinationDB)
    		.= (fn: saveGame;  param: current game, selected db, create)
    	(skip to 1f, below)
    
    3r		.<----------. (ret: create in another db)
    		.= (fn: saveGame; param: current game, db, create)
    	(skip to 1f, below)
    
    3r		.<----------. (ret: discard)
    	(skip to 1f, below (discarding changes))
    
    3r		.<----------. (ret: cancel)
    	e<--. (ret: null)
    
    2r		.<------. (ret: false)
    		.= (fn: saveGame; param: current game, db, replace)
    	(skip to 1f, below)
    
    1r		.<------. (ret: false)
    1f		.-->. (fn: loadGame; param: game descriptor)
    			.-->. (fn: isPosition)
    			.<--. (ret: true/false)
    true		.-->. (fn: first)
    false		.-->. (fn: last)
    			.-->. (fn: setPromptForUserMods; param: true)
    			.= (fn: setCurrentGame)
    		.<--. (ret: Game object)
    	e<--. (ret: Game object)
    
  • Get destination db

    Prompt user for destination db ('current', 'other', 'new', 'cancel')

    • If user selected 'new': call 'create new db'; return name of new db.
    • If user selected 'current': return name of current db.
    • If user selected 'other': call 'select game db' to get target db; return name of target db.
    • If user selected 'cancel': return value indicating user cancelled.

    1. Caller
    2. Controller
    3. BaseView
    4. DBList
    	A   B   C   D
    	s-->. (fn: getDestinationDB)
    1c		.-->. (fn: getDBType)
    1r		.<--. (ret: new)
    		.-->. (fn: getNewDBName)
    		.------>. (fn: createGameDB; param: new db name)
    	e<--. (ret: DBDescription for new db)
    
    1r		.<--. (ret: current)
    	e<--. (ret: DBDescription for current db)
    
    1r		.<--. (ret: other)
    		.-->. (fn: selectGameDB)
    	e<--. (ret: DBDescription for selected db)
    
    1r		.<--. (ret: cancel)
    	e<--. (ret: null)
    
  • Save game/pos (5.3.*)

    Write game data indicated to db indicated, creating or overwriting as indicated.

    1. Caller
    2. Controller
    3. DBList
    4. GameDB
    	A   B   C   D
    	s-->. (fn: saveGame; param: Game object, DB descriptor, overwrite flag)
    		.-->. (fn: loadGameDB; param: DB descriptor)
    		.------>. (fn: saveGame; param: Game object, overwrite flag)
    	e<--.
    

     

VA Linux Systems and SourceForge are trademarks of VA Linux Systems, Inc. Linux is a registered trademark of Linus Torvalds. All other trademarks and copyrights on this page are property of their respective owners. For information about other site Content ownership and sitewide terms of service, please see the SourceForge Terms of Service. For privacy policy information, please see the SourceForge Privacy Policy. Content owned by VA Linux Systems is copyright 1999-2000 VA Linux Systems, Inc. All rights reserved.