Commit 4965995f authored by jcechace's avatar jcechace
Browse files

Fixed README typo

parent 0cce2a25
......@@ -16,66 +16,34 @@ You might have encountered the most famous tabletop RPG game system [DnD (Dunge
### Game System Information
Our game system will be much simpler than those of DnD or DrD. We wont have any classes or leveling system. There will be just characters with predetermined set of skills and attributes.
Each character has some basic information such as name**name**, age, occupation.
In addition character also has a set of attributes (e.g. strength, dexterity) and set of skills (e.g. leadership, intimidation) -- each of these has a rank between 0 and 5.
Each character has some basic information such as *name*, *age*, *occupation*.
Additionally, each character also has a set of attributes (e.g. strength, dexterity) and set of skills (e.g. leadership, intimidation) -- each of these has a rank between 0 and 5.
As you play the game you will encounter many situations. Lets say your group captured certain street thug and needs to know what he did last night.
Since your character has the interrogation you decide to press on the thug and extract the information. The dungeon master determines that you need at least 3 success points to get the information you need.
At this point, since you character has 4 points in the interrogation skill, you roll with four 10-sided dice. If you get a result higher than 4 on at least 3 ouf them, you will succeed in interrogating the thug.
Since your character has the interrogation skill, you decide to press on the thug and extract the information. The dungeon master determines that you need at least 3 success points to convince the thug to spill the beans.
Since you character has 4 points in the interrogation skill, you roll with four 10-sided dice. If you get a result higher than 4 on at least 3 ouf these dice, you will succeed in interrogating the thug.
It's a very simple, yet versatile and fast-paced system.
### Application Usage and Overview
As already mentioned, the goal is to implement a command line utility which will produce a character sheet for our tabletop RPG. The program will recognize the following command line options
| Name | Default Value | restriction |Description |
|------|---------------|-------------|------------|
| --name | - | - | Character's name |
| --age | - | positive integer |Character's age |
| --occupation | Citizen |- | Character's occupation |
| --health | - | 1-10 |Character's health |
| --sanity | - |1-10 | Character's sanity |
| --inventory | 42 | positive, x % 3 = 0 | Character's inventory size |
| --attrs | attributes.txt | - | Attribute file descriptor |
| --skills | skills.txt | - | Skills file descriptor |
| --out | character.html | - | output file name |
| --encoding | UTF-8 | - | Encoding of input files |
| --help |false | - | when present displays program help|
Parameters without default value are mandatory and the program could be called for example as follows...
```bash
java -jar rpg-gen.jar --name "Stephen Mercer" --age 32 --occupation "Investigative Journalist" --health 5 --sanity 5 --inventory=45 \
--attrs "stephen_attrs.txt" --skills "stephen_skills.txt"
```
An example of file descriptors can be found in ```src/test/resources```. A generic format is
```text
AbilityOrSkill 5
AbilityOrSkill R
```
Each ability or sill is placed on single line defined as combination of name and level.
Level can be specified either as a number between 0 and 5 or as "R". When "R" is used as level, then the actual value is computed as a random within mentioned range.
### External Libraries
In this assignment you will encounter two useful java libraries
#### JCommander
JCommander is a small library for parsing command line arguments. The documentation and examples can be found [here](https://jcommander.org/).
In this homework you will learn just the basic by replicating what is already present in the skeleton of ```Application``` class.
You will have to learn just the basics by replicating what is already present in the skeleton of ```Application``` class or by looking into the docs.
### Thymeleaf
Thymeleaf is a very complex templating library which allows for templating of various documents from simple text, through html, to javascript files.
In this homework you will be required to fill in a small part of a template. Other than that you are encouraged to have a look at how to use this library.
Thymeleaf is a complex templating library which allows for templating of various documents from simple text, through html, to javascript files.
In this homework you will be required to fill in a small part of a template. Other than that, you are encouraged to have a look at how to use this library.
The documentation can be found [here](https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#introducing-thymeleaf).
## Evaluation
Beside functional correctness this assignment is focused on clean implementation and your understanding of Java's collection framework.
### Evaluation
Beside functional correctness this assignment is focused on clean implementation and your ability to create a more complex java application.
The maximum number of points for this assignment is **11**.
- **5 points** for passing tests (attached tests do not guarantee a 100% correctness).
- **6 points** for clean implementation and creativity.
- **4 points** for passing tests (this time attached tests are very basic).
- **4 points** for correctly working implementation.
- **3 points** for clean implementation and creativity.
Note that all this is at your seminar teacher's discretion.
......@@ -116,6 +84,43 @@ You can consult your seminar teacher to help you set the ```checkstyle.fail``` p
### Submitting the assignment
The procedure to submit your solution may differ based on your seminar group. However generally it should be ok to submit ```target/homework01-2020-1.0-SNAPSHOT-sources.jar``` to the homework vault.
### Application Usage and Overview
As already mentioned, the goal is to implement a command line utility, which will produce a character sheet for our tabletop RPG. The program will recognize the following command line options
| Name | Default Value | restriction |Description |
|------|---------------|-------------|------------|
| --name | - | - | Character's name |
| --age | - | positive integer |Character's age |
| --occupation | Citizen |- | Character's occupation |
| --health | - | 1-10 |Character's health |
| --sanity | - |1-10 | Character's sanity |
| --inventory | 42 | positive, x % 3 = 0 | Character's inventory size |
| --attrs | attributes.txt | - | Attribute file descriptor |
| --skills | skills.txt | - | Skills file descriptor |
| --out | character.html | - | output file name |
| --encoding | UTF-8 | - | Encoding of input files |
| --help |false | - | when present displays program help|
Parameters without default value are mandatory.
An example use of the program could look like this one bellow.
```bash
java -jar rpg-gen.jar --name "Stephen Mercer" --age 32 --occupation "Investigative Journalist" --health 5 --sanity 5 --inventory=45 \
--attrs "stephen_attrs.txt" --skills "stephen_skills.txt"
```
Example of the file descriptors can be found in ```src/test/resources```.
In general the format is:
```text
AbilityOrSkill 5
AbilityOrSkill R
```
Each ability or sill is placed on single line defined as combination of name and level.
Level can be specified either as a number between 0 and 5 or as "R". When "R" is used as level, then the actual value is computed as a random within mentioned range.
### Step 1: Implementing Character class
Implement the ```Character``` class with the following attributes. In order to help you a bit there is already a very sparse skeleton in place.
......@@ -130,11 +135,12 @@ Implement the ```Character``` class with the following attributes. In order to h
| skills | List<SkillOrAttribute> | character's skills |
Since the class has quite a few attributes, you should provide ```Builder``` class -- a builder implementation which will be used to construct instances of ``Character`` class.
This builder should implement ```Buildable``` interface as well as ```read.AttributeReader``` and ```read.SkillReader```;
This builder should implement ```Buildable``` interface as well as ```read.AttributeReader``` and ```read.SkillReader```.
### Step 2: Implementing the command line interface
Extend the implementation of ``Application`` class in order for it to recognise all of the command line parameters described above.
In order to validate some of the value, you will need to read section *4.1. Individual parameter validation* in JCommander's documentation.
Complete the implementation of ``Application`` class in order for it to recognise all of the command line parameters described above.
In order to validate some of the values provided on command line, you will need to read section *4.1. Individual parameter validation* in JCommander's documentation.
Program usage info should be displayed when ``--help`` is specified as command line parameter.
### Character to HTML file
......@@ -142,4 +148,5 @@ Running the ``main`` method of ``Application`` class should produce a HTML file
To achieve this you should use the Thymeleaf library already mentioned in this assignment.
To have easier time working with this library, you can use the class ```impl.AbstractHtmlWriter``` and prepared template located in ```src/main/resources```.
However this template is not complete and you will have to fill in few things.
Also notice that ``AbstractHtmlWriter`` is located inside the ```impl``` package, which means that you can modify it to suit your needs.
\ No newline at end of file
Pleas notice that ``AbstractHtmlWriter`` is located inside the ```impl``` package, which means that you can modify it to suit your needs.
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment