Skip to content

Commit

Permalink
Merge pull request #263 from CS2103-AY1819S2-W14-3/esther-docs
Browse files Browse the repository at this point in the history
Esther docs
  • Loading branch information
iwle authored Apr 2, 2019
2 parents 8bd8533 + da51a5f commit 283b876
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 8 deletions.
11 changes: 11 additions & 0 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ The `Storage` component,
* can save `UserPref` objects in json format and read it back.
* can save the Address Book data in json format and read it back.


// tag::battle[]

[[Design-Battle]]
=== Battle component

Expand All @@ -240,6 +243,9 @@ The `Battle` component,

As the


// end::battle[]

[[Design-Commons]]
=== Common classes

Expand Down Expand Up @@ -419,6 +425,8 @@ image::ListShipSequenceDiagram.png[width=1499][height=2249]
** Pros: Cleaner and easier to implement.
** Cons: Cannot check position of `Battleship` on the map grid.


// tag::battle[]
=== Battle Feature
==== Current Implementation
The Battle feature handles the following:
Expand Down Expand Up @@ -463,6 +471,9 @@ The Battle feature is split between several packages:
*** AttackCommand is now state-dependent (the state being the current attacking player) which
can more easily lead to bugs and race conditions.


// end::battle[]

=== Enemy AI Feature
==== Current Implementation
The Enemy AI feature is currently implemented as an extension of the Player class,
Expand Down
21 changes: 13 additions & 8 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -298,45 +298,50 @@ Selects the 2nd battleship in the inventory.
`select 1` +
Selects the 1st battleship in the results of the `find` command.

// tag::battle[]
=== Battle Phase

==== Beginning the battle: `begin`
>>>>>>> master

Begins the battle against the computer enemy. +
Format: `begin` +
Alternative command: `start`

****
* After this command is entered, the program's AI will place its own ships.
* After the AI completes its placing of ships, you can take your first turn.
****

==== Shooting at a coordinate: `shoot`

Launches an attack against given coordinate on the enemy's map. +
Format: `shoot COORDINATES` +
Alternative command: `attack`, `fire`, `hit`
Alternative commands: `attack`, `fire`, `hit`

Example:

* `shoot A6`

****
* The program will prevent an attack on an invalid coordinate..
* The program will prevent an attack on a square that has already been attacked.
* The program will prevent the user when attacking when they have already attacked. +
After attacking, they should use `endturn` to allow the computer to make its move.
* The program will prevent you from attacking an invalid coordinate.
* The program will prevent you from attacking a square that you have already attacked.
* The program will prevent the you from making another attack when you have already taken your turn.
After attacking, you should use `endturn` to allow the computer to make its move.
****

==== Finishing a turn: `endturn`

Ends Player turn and starts Enemy's turn. +
Ends your turn and starts Enemy's turn. +
Format: `endturn` +
Alternative command: `end`

****
* The program will end the player's turn and automatically play the Enemy's turn.
The player can see the enemy's attack reflected on the map and in the results box.
* The program will end your turn and automatically play the Enemy's turn.
Youwill see the enemy's attack reflected on the map and in the results box.
****
// end::battle[]

// tag::stats[]
=== Retrieving game statistics: `stats`

Expand Down
62 changes: 62 additions & 0 deletions docs/team/estherchongsw.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
= Ian Wu - Project Portfolio for Battleship
:site-section: AboutUs
:imagesDir: ../images
:stylesDir: ../stylesheets

== Project: Battleship CLI

Battleship CLI is an implementation of the classic game Battleship.

As part of a group project in the module https://nus-cs2103-ay1819s2.github.io/cs2103-website/index.html[CS2103] in NUS,
my group had to morph an existing product, https://github.com/nus-cs2103-AY1819S2/addressbook-level4[`addressbook-level4`],
into a new product, and we chose to morph it into an Battleships, while keeping the original product's
distinctive feature of being operated through the command-line.

My role in the team was to design and implement the `Battle` feature, which:

* Ensures that the human and computer players each take their turns in order,
* Ensures that the game progresses in a fixed sequence of stages (from setting up the map, to placing ships, to attacking)

The following sections illustrate the feature in more detail, as well as the relevant sections I have added to the user and developer guides in relation to this feature.

== Summary of contributions

* *Major enhancement*: added *the battle feature of the game*
** What it does: it allows the player to make attacks, and ensures that the player and enemy take turns with each other.
** Justification: the battle feature is important as it is one of the two important phases of Battleship, along with the placing of ships.
** Highlights: [placeholder]
** Credits: [placeholder]

* *Code contributed*: Here are my [https://github.com/CS2103-AY1819S2-W14-3/main/commits/master?author=iwle[code commits]].

* *Other contributions*:

** Project management:
*** [placeholder]
** Enhancements to existing features:
*** [placeholder]
** Documentation:
*** [placeholder]
** Community:
*** [placeholder]
** Tools:
*** [placeholder]

== Contributions to the User Guide


|===
|_Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users._
|===

include::../UserGuide.adoc[tag=battle]

== Contributions to the Developer Guide

|===
|_Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project._
|===

include::../DeveloperGuide.adoc[tag=battle]

---

0 comments on commit 283b876

Please sign in to comment.