Overview

(documentation v.2)

The Sjambok API is designed to be a friendly, easy to use API for abstracting crossword puzzle games so that they may be used with a front end. Therefore, emphasis on data management, game specifics etc is emphasized in the engine. Data communication between front end and engine is accomplished through only two functions, whose parameters determine the kinds of data exchanged. The API as it currently is explained below. However, some information, such as number of players and their codes, is best accessed from sjmParameters.

The workhorse of the application will be the sjmEngine. It handles all move validation, data updates, and anything else the game needs to function. An application merely needs to process the user input a format palatable to the engine, and then send the information to it. Each instantiation of the engine represents a separate game; thus, multiple engines can be initialized to run multiple games at once. This could be useful as a sort of crossword games server. It currently can be initialized with sjmParameters, a class that carries initialization information. Once a saved game format is developed, the engine can create a new instance with a saved game. An engine will cleanly destruct; there are no shared variables between servers, and it relies on no global variables. Each function is explained below.

sjmMove is the communication medium by which player moves are sent. The player code is used so that players cannot impersonate each other; a hacked client could send a move with another player's id if it weren't randomized. The code is generated by sjmParameters. Before any kind of data should be set, the move type must first be set. The following move types are:


sjmParameters is a class used to initialize a new sjmEngine. It provides a pointer to the dictionary, the board, the bag, and of course, play parameters and number of players. It also contains the code generation for the players.

The listing above does not list everything in the API so far; only what has been definitely frozen. Please give me feedback I know it is very vague, but within a few weeks, it will all be made crystal clear.