Skip to content

User Stories

Trey edited this page Feb 3, 2017 · 24 revisions
  1. Card: As a Developer, I want simple methods to convert our battleship model from a JSON to a Java object (and vice versa) and communicate between the front and back-ends so that I can easily send the model back to the server or client.
  • Conversation: Need to create Java object for model, then convert to JSON and send to client. Need to be able to fetch JSON from client, then convert all elements of the JSON back to Java object for computational operations. Communication between client and server will be done via HTTP methods GET and POST.
  • Confirmation: 2 tests - printout/check Java class object values after conversion (and creation), then check the front-end and see if changes have been correctly applied to game board to prove that Java object has been transferred back into JSON.
  1. Card: As a Developer, I want a Battleship model that can easily modify itself to implement game actions.
  • Conversation: Initial Java object must be created for usage throughout program. Modification will occur server side via Java code - after JSON has been converted to Java object, conditionals can be used to check what the move made was (the GET request in question) and modify values in the Java class (the server side Battleship model).
  • Confirmation: Easiest way to test would be via server side printouts (in Spark?)
  1. Card: As a User, I want to be able to add a ship so that I can start a game.
  • Conversation: Just like in the board game, User should be able to position and rotate their specified number of battleships before the game commences. This will occur in the view on the client side (because it requires user input), either by selecting the position with the mouse, or entering the desired coordinates for each ship.
  • Confirmation: The view should display the ships that the user places, thereby confirming their locations and placements. Also could printout back-end values corresponding with the ships to ensure they initialized correctly.
  1. Card: As a User, I want to have a computerized opponent that can place ships and take turns so that I can play the game.
  • Conversation: How random is the computer going to be? Does it place ships in the same spot every time? Does it randomly place ships? Does it randomly fire or work in an axis around a hit that it lands? How smart do we want our AI? From a technical standpoint - this will need to be able to be accessed based on automated POST requests, then the JSON/Java Object will be modified by the computer player methods.
  • Confirmation: There should be some sort of feedback on the front-end, depending on whether we implement the back-end correctly.
  1. Card: As a User, I want to be able to fire a shot so that I can play the game.
  • Conversation: Each turn, both the player and the computer will have one shot to fire. The player will choose the coordinates of this shot by either clicking on the game board or entering the desired coordinates in some input box. If the shot hits an opponent ship, it will be registered as a hit.
  • Confirmation: The view should express exactly where the shot went, thereby confirming the code behind the shot. Additional print out messages from the back-end could give a more in-depth confirmation.
  1. Card: As a User, I want to see the game board so that I can play the game easily.
  • Conversation: This has already been implemented in the front-end. However, if someone wants to modify the front-end files (and doesn't make them incompatible with the JSON template and server code), that's perfectly acceptable.
  • Confirmation: Load the game and view the front-end HTML file.
  1. Card: As a User, I want the game to have winning and losing conditions so I won't be stuck eternally playing the game until some external factor triggers some failure in the code.
  • Conversation: Once all ships of either the computer or player have been sunk, a conditional needs to be implemented to end the game and close or wipe necessary files (ex game model). As per TA instructions, don't have to restart - just have to end.
  • Confirmation: Function will check if Battleshipmodel.playerHits[] or Battleshipmodel.computerHits[] == 16. If so, then game model will wipe.
Clone this wiki locally