Please note: The structure of the project has changed since this page was created. The design should still be valid, but we are no longer using structures
This project has been set up in an object-oriented manner, utilizing the bonuses of both OO and functional programming languages. Each "Object" is a separate set of functional commands to perform the actions needed for the "Object".
Library | "State" Variables | Functors |
Space |
Name Index/ID Card List Character List Number of Gold Region ID Neighbour List
Condition for Neighbouring |
Encounter Init |
Board/Region |
Space List Region ID |
FindSpace Init |
Character |
Start & Current:
Spell List Follower List Object List Maximum Followers Maximum Spells Maximum Objects |
Turn (* Move *)
AttackPlayer (* Called on player attacking *) Battle Modifier (* Strength modify *) Psychic Combat Modifier (* Craft Modify *) Init |
Spells |
Text (* Description *)
Name ID WhenUsed |
Use Init |
Cards |
Text (* Description *) Name ID Priority WhenUsed WhoUse Persistency (* Action *) |
Use Do Init |
Game |
RegionList PlayerList DrawCardList DiscardCardList PurchaseList DrawSpellList DiscardSpellList DrawCharacterList DeadCharacterList |
Shuffle Main (* Engine *) Init |
The table shows the "Object" name, the variables that would be needed in an OO design, but are now varying functions, and the functors that are needed to act upon these variables. Each Object has an ID number and some name or description of the card. These would be used to tell the player about the card.
The following diagram attempts to show how the modules would interact. The colours are a bit off, appering much clearer on the system used to draw the graphic. Below the graphic is a table, a key if you will, explaining what the differenct colours represent. Below that there is a paragraph explaining, in words, what the diagram shows.
Initialize | |
shuffle | |
encounter | |
Use | |
Find | |
Modifiers | |
Turn Action |
The initialize methods are called when the program is started. They set all the state "variables" for the game. The Game calls Init calls the Init functions in Region, Character, Card, and Spell. Each of these simply sets itself up, in whatever manner it needs to. Region will call Space Init, because the Region is made up of Spaces. Card Init will create a single card. The Game would have a deck of such Cards and would Init each one of them, calling shuffle when it finishes. This same method would be enacted on the Spells. Character Init would be used to initialize the Characters that are being played with, as selected by the Game.
Game Init would have multiple portions. Before calling Character Init, the Game Init would randomly select Characters for the Players to be. It would then call only those Init's in Character, storing the result in getCharacter functions.
The Game would then only iterate and call the Characters Turn function. The Game would then be, effectively, removed from the game.
The Character's Turn function would then call Space's findNeighbours function to find out where the Player can go, after "rolling" a dice. The Player would select from the list returned by Space, and call the new Space's Encounter function.
A Space's Encounter function would then check itself to see if the Player has options here (is there another Character here?). If the Player selects to Combat another Character, the Player's Character's Combat function would be called.
A Character's Combat function would call the Character's getModifier function to change the Character's score for the combat. It would then "roll" dice to determine which Character wins, and effect the change of life/etc. This would involve the user selecting what they wanted, if they have a choice. The losing Player's Character will have to make calls to it's SavingThrow functions to determine if any armour/etc it has saved it.
If there is no other Character, or if the Player chooses not to combat them, the Space must draw Cards until it has the number it is expected to hold. The Character will then Encounter these cards by calling their Do functions.
A Card's Do function will simply return any bonus or such that the Character gets from having the Card. If the Card is a creature/spirit, then the Do function will act as the Character's Combat function did. Some Cards will have to "randomly" appear somewhere on the board. This will be accomplished by them calling the findSpace function in Region.