Skip to content

Architecture Functional Requirements

vCra edited this page Feb 16, 2017 · 5 revisions

#Architecture Functional Requirements

Flow Chart should go here at some point

##FR1 - Player Setup

  • IDs for the players would be: 1, 2, 3, 4

##FR2 - Port Setup

  • a class for home ports
    • owner
    • player treasures
    • trading functionality
  • a class for trade ports
    • trading functionality

##FR3 - Crew cards

  • Deck to keep track of the cards
    • deal cards to players
    • create a stack of cards (shuffle into a deck)

##FR4 - Chance cards

  • Chance card deck inheriting from a generic Deck

  • To create a deck the program will read from a CSV to read info

    • three fields: Card number, text, implementation notes
      • Card number: from 1 to 28
      • Text to display in GUI
      • Implementation for the program to carry out the effect of the card
    • a stack in the chance card deck
    • a method with a switch which will call the effect methods in the card class
  • special cards:

    • Anchor Bay (2 cards)
    • Long John Silver (only played in port, keep track where is he)
    • Doubloons and Pieces of eight (only played in port)
  • cards have to go back to the deck (except for Long John Silver)

##FR5 - Treasure management

  • keep track of chance cards (deck)
  • keep track of treasures
  • players can take cards and treasures

##FR6 - Player management

  • player object
    • id
    • name
    • position
    • direction
    • treasure on the ship
    • crew card
    • owned port
  • movement management
    • calculating allowed movement
    • checking if the movement value is possible (e.g. if there's any obstacles in the way)
  • attacking management
    • calculating attack power

##FR8 - Flat Island

  • a class for it
  • functionality:
    • take or drop crew cards
    • take or drop treasure

##Pirate Island

  • only for storing crew cards

##FR10 - Game Setup

  • Deck will deal 5 cards in player order
  • then 2 cards to trading ports (not home ports)
  • the value of the items is added up to 8 by adding treasures

##FR11 - Taking turns

  • keep track who's turn is taking place
  • move or turn
  • check what square your ship land on
  • if next to an island or in the port begin sequence

##FR12 - Attacking ☠️

  • get the values from each player
  • compare them
  • higher wins
  • check if the loser have treasure
  • winner can take or exchange the treasure
  • the rest of the treasure is placed in the treasure island
  • the loser has to make a free move in any direction (also attacked ship if the fight was drawn)
  • can't attack ships in ports or on the coast of treasure island

##FR15 - Arriving at the port

  • check if it's the home port
    • store the player's treasure in the port
  • when that happens begin trading sequence
  • you can either trade or play chance cards if possible
  • trading:
    • from GUI get the desired trade
    • check if that is possible (e.g. if the value are equal to each other)
    • notify the GUI of that
    • if possible make the swap
  • if you have a chance card you can play it
  • other players can steal your treasure by trading their crew cards

##FR16 - Anchor Bay

  • if player has a chance card no. 25 or 26 and happens to be on square (0, 19)
  • player can take up then treasure up to value of 7 if they have space on the ship
  • the card is then spent

##FR17 - Detection of end of game

  • every time player's ship arrives at the port
    • unload the treasure
    • check if the total value of treasure is 20 or more
    • if yes, that player wins
    • fireworks 🎆
    • game finishes
  • when that happens the game should ask if they want to start another one

Clone this wiki locally