• No results found

Structural Requirements (Environment Model and Concept Model)

3 Requirements Models

3.1 Structural Requirements (Environment Model and Concept Model)

Type Definitions:

Player

Name: Type of ‘Name’ is String

IP: Type of ‘IP’ is String of Type xxx.xxx.xxx

Avatar Type of ‘Avatar’ is relative address to an image (jpg/png/jpeg) (i.e. “/img/source/

player1.jpg”)

VP Type of ‘VP’ ( victory points ) is integer range 0 to MaxVP

Asset

AssetType: Type of ‘AssetType’ is String

Count: Type of ‘Count’ is integer range 0 to resource max

FlipChart

State: Type of ‘State’ is Integer Triplet <trade level, politics level, science level>

Die

Colour: Type of ‘Colour’ is enum {red, yellow}

NumberedDie

NumberedFaces: Type of ‘NumberedFaces’ is integer array with range 0 to 6

EventDie

SymbolFaces: Type of ‘SymbolFaces’ is String array

Trade

Sender: Type of ‘Sender’ is Player object Receiver: Type of ‘Receiver’ is Player object

Offer: Type of ‘Offer’ is int array of size [9] with resources/commodities to trade count

Request: Type of ‘Request’ is int array of size [9] with resources/commodities to receive count

BarbarianShip

Position: Type of ‘Position’ is int with range 1 to 8

ProgressCar d

CardType: Type of ‘CardType’ is String

Count: Type of ‘Count’ is integer with range 0 to 54

StackOfProgressCard

StackType: Type of ‘StackType’ is enum {trade, politics, science}

Board

ID: Type of ‘ID’ is random integer

Size: Type of ‘Size’ is integer with range 0 to 40

Error

Error: Type of ‘Error’ is Throwable toShow: Type of ‘toShow’ is Boolean resolutionTimer: Type of ‘resolutionTime’ is Time

Tile

ID: Type of ‘ID’ is integer

TileType: Type of ‘TileType’ is enum {gold, desert, fields, forest, pasture, mountains , hill}

DieNumber :

Type of ‘DieNumber’ is integer with range 2 to 12

Status: Type of ‘Status’ is enum {empty, robber, merchant, pirate, building}

Edge

ID: Type of ID is integer

Status: Type of ‘Status’ is enum {empty, knight, building}

Location: Type of ‘Location’ is integer doublet of 2 IDs of tiles forming intersection

Intersection

ID: Type of ID is integer

Status: Type of ‘Status’ is enum {empty, road, ship}

Location: Type of ‘Location’ is integer triplet of 3 IDs of tiles forming intersection Knight: Type of ‘Knight’ is boolean

Message

Sender: Type of ‘Sender’ is Player object Receiver: Type of ‘Receiver’ is Player object Message: Type of ‘Message’ is String

Unit

ID: Type of ID is integer

Location: Type of ‘Location’ is an int triplet with range 0 to Board:Size

Building

BuildingType Type of ‘BuildingType’ is enum {settlement, city, city with walls, city with metropolis}

Knight

Activated: Type of ‘Activated’ is boolean Rank: Type of ‘Rank’ is int

Environment Model:

Concept Model:

Input Messages:

Inputs Message

setupRemoteClient() Sent by RemoteClient to create a new NetworkClient instance

setupLocalClient() Sent by LocalClient to create a local NetworkClient, since the client is local, it automatically connects to the local server

initiateNewGame() Sent by Server to create new game lobby. Within the operation, Server is created with default network and game steup.

initiateLoadGame() Sent by Server to start a load game lobby. Within the operation, Server is created with default network and saved game steup.

setSettings(int[] settingVector) Sent by Server to set a setting for victory points, etc selectBoard (Board newBoard) Sent by Server to select a board RemoteClient can vote on lockBoardVote (Boolean vote) Sent by Server to lock board choice and prevents further voting by

RemoteClient

selectSavedGame (Game saveGame) Sent by Server to select saved game to load

startGame() Sent by Server to start the game

joinGame(String IP) Sent by RemoteClient to join a game

boardVote(Boolean vote) Sent by RemoteClient to vote on current board choice selectCharacter(Player player) Sent by Client to select an in-game character to play as

saveGame( ) Sent by LocalClient to create a save game file of the current game sendGameSaveMsg(String message) Sent by Server to confirm whether the game has been successfully saved

rollDice() Sent by Client to roll the dice

broadcastDiceOutcome(Array<Die>

diceOutcome)

Sent by Server to boardcast a dice roll outcome

drawProgressCard(StackType type) Sent by Client to draw new Progress Card(s)

discardProgressCard(ProgressCard card)

Sent by Client to remove a progress card when the Client was forced to discard Progress Cards

discardResourceAndCommodities(int[]

toDiscard)

Sent by Client to remove Resource(s)/Commodities when the Client was forced to discard Progress Cards

moveRobber(Tile destination) Sent by Client to change Tile position of the Robber playProgressCard(ProgressCard card) Sent by Client to play a progress card from their hand

promoteKnight(Knight knightToPromote)

Sent by Client to promote the strength of their knight by 1 stage

moveKnight(Knight knightToMove) Sent by Client to move one of their knights within the game board chaseKnight(Knight owned, Knight

other)

Sent by Client to displace one of their opponent’s knights to another location

activateKnight(Knight knightToActivate) Sent by Client to activate an inactive knight they own chaseRobber(Knight

knightToChaseRobbr)

Sent by Client to use a Knight unit to chase away (change the tile location) of the Robber game piece

chasePirate(Knight knightToChasePirate)

Sent by Client to use a Knight unit to chase away (change the location) of the Pirate game piece

buildUnit(Unit u, Location(an int triplet with range 0 to Board:Size) location)

Sent by Client to build a unity entity

acquireCityImprovement(...) Sent by Client to build city improvement

stealMetropolis(Player p,Metropolis metropolis, Location(an int triplet with range 0 to Board:Size)location)

Sent by Client to steal player p’s metropolis

deleteUnit(Unit todelete) Sent by Client to delete a selected unit createTrade(Player sender, Player

reciever, int [] offer, int[] request)

Sent by Client to create a Trade object

submitTrade(Trade newTrade) sent by Client to inform that a trade has been initialized responseToTrade(boolean response) Sent by Client to respond to a trade offer

sendTrade(Trade newTrade) Sent by Server to notify of new trade

sendResponseToTrade(boolean response)

Sent by Server to notify trade response

endTurn() Sent by Client to end the current turn

localClientQuitGame() Sent by LocalClient when LocalClient quits game, this is necessary because if it is LocalClient quitting the game, the Server is going to be down as well.

Unet defaults to server migration at this point, which will be turned off in order to pervent the game continuing on without the Server, thereby perventing inconsistencies.

remoteClientQuitGame() Sent by RemoteClient when RemoteClient quits game. In this case, there are two possible senarios happening: 1. all Clients can either wait until a player joins in; OR 2. all Clients can decide to restart a new game. (Server Migration is not needed).

sendChatMessage(Message m) Sent by Client/Server to communicate a chat message broadcastChatMessage(Message m) Sent by Server to communicate a new message

broadcastGameState(Board newState) Sent by Server to boardcast the new updated Board Object from Server to all Clients

moveMerchant(Merchant merch) Sent by Client to Server to communicate a merchant movement broadcastError(Error e) Sent by Server to client to notify of error

Output Messages:

broadcastEndGame(enum gameEndCase)

Sent by Server to client to notify game is ending. This is triggered either 1.

When a Client has quited the game and no new Client joining within the given time (gameEndCase={clientQuit}); 2. When a Client has reached maximum Victory Point and won the game.(gameEndCase={clientWin})

displayClientSetup() Sent to Client to inform a successful Client Creation

onConnection() Sent to Client to inform of a successful connection has been built to the Server

joinGameAck() Sent to Server to acknowledge (verify) that a RemoteClient has joined the game, this can be a prerequisite to starting a game

displayErrors() Sent to Server and/or Client to notify of an error occuring lockBoardVoteAck() Sent to Server to notify voting has been disabled

displayGameSetup() Sent to RemoteClient to notify of the current board selection

startGameAck ( ) Sent to Server to inform that the game is starting serverCreatedAck() Sent to Server to notify of a new server creation localClientQuitGameAck ( ) Sent to LocalClient to inform that the game is exiting remoteClientQuitGameAck ( ) Sent to RemoteClient to inform that the game is exiting saveGameAck( ) Sent to Server to inform that the game has been saved

displayGameSaveMsg() Sent to LocalClient to inform of whether the game has been successfully saved

diplayChatMessage Sent to Client to communicate a new message sendChatMessageAck() Sent to Server to notify of new message displayBoardVote() Sent by Server to confirm board vote

displayDiceOutcome() Sent by Server to display a dice roll result

forceResourceAndCommoditiesDiscard() Sent to Client to force Client to remove resources and/or commodities forceProgressCardDiscard() Sent to Client to force Client to remove Progress Card(s)

displayMerchantOutcome() Sent to Client when the existance of the Merchant game piece affects resource collection after a die roll event

displayRobberOutcome() Sent to Client when the existance of the Robber game piece affects resource collection after a die roll event

displayPirateOutcome() Sent to Client when the existance of thePirate game piece affects resource collection after a die roll event

displayBarbarianAttackOutcome() Sent to Client when the barbarian attack event occurs within the game

displayProgressCardOutcome() Sent to Client when a progress card is played

forceKnightMovement() Sent to Client when one of Client’s knights is being driven by another higher ranking knight and must be moved

receiveTradeAck() Sent to Server when a Trade is initialized by a Client responseToTradeAck() Sent to Server when a Client replys to a Trade

displayResponseToTrade(Trade tradeResult) Sent to Client to notfiy of the Response to Client’s Trade offer updateGameState() Sent to Client to update the display of various game objects based on

other objects such as:

- Unit changes - Dev Chart Changes

- Robber/Merchant/Pirate position - Barbarian ship position - Progress card changes - Player changes

forceToTrade(Trade tradeOffer, Player tradee) Sent to Client to force a trade to occur receiveChatMessage(Message m) Sent to Client to show new chat message diceOutcomeAck(Array<Die> diceOutcome) Sent to Server to notify Server of the dice outcome displayTrade(Trade tradeOffer) Sent to Client to notify a trade offer

endTurnAck() Sent to Server that a Client is ending a turn

recieveGameState() Sent to Server to notify of changes in game objects based on objects - Unit changes

- Dev Chart Changes

- Robber/Merchant/Pirate position - Barbarian ship position - Progress card changes - Player changes

displayEndGame(enum gameEndCase) Sent to Client to notify the Game has ended.

Related documents