Contracts

Use case: Create Human

SelectCreateHuman

Contract
Name: selectCreateHuman()
Responsibilities: Selects the createHuman option.
Type: System
Cross References

System Functions: R2.3

Use Cases: Create Human

Notes:  
Exceptions:  
Output:  
Pre-conditions:  
Post-conditions:
  • WorldController.createHuman was set to true (attribute modification).

selectSquareofLand

Contract
Name: selectSquareofLand(square)
Responsibilities: Selects a square of land.
Type: System
Cross References

System Functions: R2.3

Use Cases: Create Human, Perform Action

Notes: NA
Exceptions: NA
Output: NA
Pre-conditions: NA
Post-conditions:
  • WorldController.selectedSquare is set to square (attribute modification).

createHuman

Contract
Name: createHuman( )
Responsibilities: Create a normal human
Type: System
Cross References

System Functions: R1.4, R1.5, R2.1, R2.2, R2.3, R2.4, R3.1 

Use Cases: Create Human

Notes:  
Exceptions:
  • If the selected square of land is already taken by an other human, indicate that it was an error.
  • If the Player has not enough creation power to create an other human, indicate that it was an error.
  • If the selected square of land is not explored, indicate that it was an error.
Output:  
Pre-conditions:  
Post-conditions:
  • A Human was created (instance creation).
  • The Human was associated with the selected SquareOfLand (association formed).
  • World.CreationPower was decreased (attribute modification).
  • Human.timeToLive was initialized (attribute modification).
  • Human.action was set on the default action (attribute modification).
  • Human.visionRange was set on the default vision range (attribute modification).

 

Use case: Perform Normal Action

selectHuman

Contract
Name: selectHuman(human)
Responsibilities: Adds a human to a selection of humans
Type: System
Cross References

System Functions: R2.3, R2.4

Use Cases: Perform Normal Action, Create Construction

Notes:  
Exceptions:

 

Output:  
Pre-conditions:  
Post-conditions:
  • If a new selection, a HumanSelection was created (instance creation).
  • If a new selection, the new HumanSelection was associated with the WorldController (association formed).
  • The Human was associated with the HumanSelection (association formed).

selectAction

Contract
Name: selectAction(action)
Responsibilities: Selects an action to be performed by some selected humans
Type: System
Cross References

System Functions: R2.3

Use Cases: Perform Action, Create Construction

Notes:  
Exceptions:  
Output:  
Pre-conditions:  
Post-conditions:
  • WorldController.actionName was set to action (attribute modification).

selectSquareofLand

Already defined. (See Create Human.)

startAction

Contract
Name: startAction()
Responsibilities: Starts the action to be performed by some selected humans
Type: System
Cross References

System Functions: R1.4, R1.5, R2.1, R2.2, R2.3, R2.4, R3.2 

Use Cases: Perform Action

Notes:  
Exceptions:
  • If the selected square of land is already taken by an other human, indicate that it was an error.
  • If there are no humans selected, indicate that it was an error.
Output:  
Pre-conditions:  
Post-conditions:
  • The Human which is to perform the action was removed from the HumanSelection.humans (attribute modification).
  • The Human was associated with the selected SquareOfLand (association formed).
  • The Human was associated with the selected Action (association formed).

 

Use case: Create Construction

selectHuman

Already defined.

selectAction

Already defined. In this case the selected action is Constructing.

selectConstructionType

Contract
Name: selectConstructionType(type)
Responsibilities: Selects a constructiontype to be build by some selected humans
Type: System
Cross References

System Functions: R2.3

Use Cases: Create Construction

Notes:  
Exceptions:  
Output:  
Pre-conditions:  
Post-conditions:
  • WorldController.constructionName was set to type (attribute modification)

selectConstructionShape

Contract
Name: selectConstructionShape(shape)
Responsibilities: Selects a shape for the construction.
Type: System
Cross References

System Functions: R2.3

Use Cases: Create Construction

Notes:  
Exceptions:  
Output:  
Pre-conditions: A constructiontype must have been selected.
Post-conditions:
  • WorldController.constructionShape was set to shape (attribute modification)

selectSquareOfLand

Already defined. (See Create Human.)

startConstructing

Contract
Name: startConstructing()
Responsibilities: Starts the constructing action to be performed by some selected humans
Type: System
Cross References

System Functions: R1.4, R1.5, R2.1, R2.2, R2.3, R2.4, R3.2 

Use Cases: Create Construction

Notes:  
Exceptions:
  • If the selected construction location is already taken by an other human or an other construction, indicate that it was an error.
  • If there are no humans selected, indicate that it was an error.
  • If a non-applicable constuction location is selected, indicate that it was an error.
Output:  
Pre-conditions:  
Post-conditions:
  • The Human which is to perform the constructing action was removed from the HumanSelection.humans (attribute modification).
  • The Human was associated with the selected SquareOfLand (association formed).
  • The Human was associated with the selected Action: constructing (association formed).
  • A Construction was created (instance creation).
  • Constructing.construction was set to the selected construction (attribute modification).

 

Use Case: Stop Action

stopAction

Contract
Name: stopAction()
Responsibilities: Starts the action to be performed by some selected humans
Type: System
Cross References

System Functions: R1.4, R1.5, R2.1, R2.2, R2.3, R2.4, R3.2 

Use Cases: Stop Action

Notes:  
Exceptions:  
Output:  
Pre-conditions:  
Post-conditions:
  • The Human was associated with the Action: resting (association formed).

 

Use Case: Resume Game

resumeGame

Contract
Name: resumeGame( )
Responsibilities: Resume a paused game.
Type: System
Cross References

System Functions: R1.7, R2.1, R2.2, R2.3, R2.4

Use Cases: Resume Game

Notes:  
Exceptions:  
Output:  
Pre-conditions:
  • Evolution must be paused.
Post-conditions:
  • Evolution.running is set to true (attribute modification).

 

Use Case: Pause game

pauseGame

Contract
Name: pauseGame( )
Responsibilities: Pause the game, thereby pausing the evolution.
Type: System
Cross References

System Functions: R1.7

Use Cases: Pause Game

Notes:  
Exceptions:  
Output:  
Pre-conditions:
  • Evolution must be evolving.
Post-conditions:
  • Evolution.running is set to false (attribute modification).

 

Use Case: Start Up

startUp

Contract
Name: startUp()
Responsibilities: Initialize the system
Type: System
Cross References

System Functions:

Use Cases: Start Up

Notes:  
Exceptions:  
Output:  
Pre-conditions:  
Post-conditions:
  • An instance of Userinterface was created (instance creation).

Use Case: Create New Game

createNewGame

Contract
Name: createNewGame()
Responsibilities: Creates and start a new game.
Type: System
Cross References

System Functions: R1.1, R1.2, R2.1, R2.2, R2.3, R2.4

Use Cases: Create New Game

Notes:  
Exceptions:
  • If some instances can't be initialized properly, indicate that is was an error.
Output:  
Pre-conditions:  
Post-conditions:
  • WorldController has been created (instance creation).
  • World has been created (instance creation).
  • World was associated with WorldController (association formed).
  • EvolutionKnowledgeCatalog has been created (the properties for initializing the EvolutionKnowledgeCatalog are found in the evolution.prop file)
  • ResourceKnowledgeCatalog has been created (the properties for initializing the ResourceKnowledgeCatalog are found in the resources.prop file)
  • LandKnowledgeCatalog has been created (the properties for initializing the LandKnowledgeCatalog are found in the lands.prop file)
  • ActionKnowledgeCatalog (the properties for initializing the ActionKnowledgeCatalog are found in the actions.prop file)
  • ConstructionKnowledgeCatalog (the properties for initializing the ConstructionKnowledgeCatalog are found in the lands.prop file)
  • Evolution has been created (instance creation).
  • GameBoard has been created (instance creation).
  • GameBoard was associated with World (association formed).
  • HumanSelection has been created (instance creation).
  • SquareOfLand has been initialized (instance creation).
  • WorldController was associatied with SquareOfLand (association formed).
  • WorldController.actionName was set to the default action (the default action can be found in de ActionKnowlegdCatalog) (attribute modification).
  • WorldController.constructionName was set to null (attribute modification).
  • WorldController.createHuman was set to false (attribute modification).
  • Resource(s) has(have) been created (the properties for initializing those are found in the ResourceKnowledgeCatalog).
  • World was associated with the Resource(s) (attribute modification).
  • CreationPower has been created (instance creation).
  • World was associated with CreationPower (association formed).
  • CreationPower.creationAmount was initialized (the properties for doing this are found in the EvolutionKnowledgeCatalog)
  • CreationPower.humanCreationDecrease is initialized (the properties for doing this are found in the EvolutionKnowledgeCatalog)
  • CreationPower.creationIncrease was initialized (the properties for doing this are found in the EvolutionKnowledgeCatalog)
  • CreationPower.max was initialized (the properties for doing this are found in the EvolutionKnowledgeCatalog)
  • Eventmanager has been created (instance creation).
  • The different components of the UserInterface have been layed out (the properties for doing this can be found througout the different KnowledgesCatalogs) (attribute creation).

Remark: For this last Contract we tried to only mention the really essential post-conditions.