Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the rest of the documentation for the code. #78

Merged
merged 34 commits into from
Dec 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
802fb32
Removed outdated todo comment.
JayTSmith Dec 8, 2017
2ae506f
Added documentation for CharManageFragment.
JayTSmith Dec 11, 2017
16b50b5
Added documentation for ExperienceDialogFragment.
JayTSmith Dec 11, 2017
5d65c54
Added documentation for LevelStatSelectDialogFragment. Also fixed typo.
JayTSmith Dec 11, 2017
638412d
Added documentation for LevelResultDialogFragment. Also added details.
JayTSmith Dec 11, 2017
5b1ca1d
Added documentation for HitsChangeFragment.
JayTSmith Dec 11, 2017
658c65f
Added documentation for InventoryFragment.
JayTSmith Dec 11, 2017
061d2ae
Added documentation for StatChangeFragment.
JayTSmith Dec 11, 2017
604c852
Added package-info to fragments package.
JayTSmith Dec 11, 2017
dd89086
Added documentation for AttributePriorityDialog.
JayTSmith Dec 11, 2017
7ce8e36
Added documentation for DetailDialogFragment. Also fixed more typos.
JayTSmith Dec 11, 2017
63a7588
Added a package-info to NewCharacter.dialogs package.
JayTSmith Dec 11, 2017
740d87d
Added missing ol tag.
JayTSmith Dec 11, 2017
adff7f4
Added documentation for CharacterCreationFragment.
JayTSmith Dec 11, 2017
b13dee9
Added documentation for CreateCharacter.
JayTSmith Dec 11, 2017
36bbf8c
Added package-info to NewCharacter package.
JayTSmith Dec 11, 2017
4a16316
Added authors to package-infos.
JayTSmith Dec 11, 2017
41059ad
Added documentation to CompanionFragment.
JayTSmith Dec 11, 2017
a0ccd6d
Removed an incorrect statement in the javadoc.
JayTSmith Dec 11, 2017
db7d6cb
Added documentation to PlayerManualFragment.
JayTSmith Dec 11, 2017
1586b24
Added documentation to WebsiteFragment.
JayTSmith Dec 11, 2017
45826cd
Added package-info to web_resource package.
JayTSmith Dec 11, 2017
3518e7a
Added documentation for everything related to Equipment.
JayTSmith Dec 11, 2017
c5e16b3
Added documentation for AttackResultFragment.
JayTSmith Dec 11, 2017
d0a9ad0
Added documentation for AttributeScore.
JayTSmith Dec 11, 2017
34ceb70
Added documentation for AttributeScoreGenerator.
JayTSmith Dec 11, 2017
408120c
Added documentation for CharacterAdapter.
JayTSmith Dec 11, 2017
1850230
Added docs for CharacterSelection and CharacterDeletion fragments.
JayTSmith Dec 11, 2017
57f9453
Added docs to CharacterManageActivity.
JayTSmith Dec 12, 2017
c7d974e
Added docs to CharacterPlayActivity. Also added author tag to Charact…
JayTSmith Dec 12, 2017
8d3bcb2
Added docs to CharacterSheetFragment.
JayTSmith Dec 12, 2017
3189135
Added docs to the rest of the classes.
JayTSmith Dec 12, 2017
c5da550
Added package-info to the base level package.
JayTSmith Dec 12, 2017
61d66e2
Merge branch 'master' into develop
JayTSmith Dec 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,23 +1,46 @@
package com.example.cis.mazeminotaurs;

/**
* Created by Thorin Schmidt on 3/20/2017.
* This class serves as a container for data related to an armor piece.
*
* @author Thorin Schmidt on 3/20/2017.
*/

public class Armor extends Equipment {

//instance variables
/**
* The bonus defense granted by wearing this armor piece.
*/
private int mDefenseBonus;

/**
* {@inheritDoc}
*
* @param resId The name of the armor.
* @param encumberance The encumberance value of the armor.
* @param quantity The number the player is holding.
* @param costInSp The cost of the armor in silver.
* @param longDescription The description of the armor.
* @param defenseBonus The defense bonus of the armor.
*/
public Armor(String resId, int encumberance, int quantity, double costInSp, String longDescription, int defenseBonus) {
super(resId, encumberance, quantity, costInSp, longDescription);
mDefenseBonus = defenseBonus;
}

/**
* Getter for the mDefenseBonus property.
* @return the value of mDefenseBonus
*/
public int getDefenseBonus() {
return mDefenseBonus;
}

/**
* Setter for the mDefenseBonus property.
* @param defenseBonus the new value of mDefenseBonus
*/
public void setDefenseBonus(int defenseBonus) {
mDefenseBonus = defenseBonus;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,73 @@
import com.example.cis.mazeminotaurs.rollDice.rollDice;

/**
* Created by Thorin Schmidt on 4/13/2017.
* This fragment displays the results of an attack roll and damage roll of the
* equipped weapon.
* The user can also click to get a second damage roll for critical damage.
* @author Thorin Schmidt on 4/13/2017.
*/

public class AttackResultFragment extends DialogFragment {

/**
* The index of the character in the Portfolio singleton.
*/
int mCurrentCharacterIndex;

/**
* The list of all of the player's characters.
*/
Portfolio mPortfolio;

/**
* The character that is currently being used.
*/
PlayerCharacter mCurrentCharacter;

/**
* The score modifier being used, based on weapon type.
*/
int mMod;

/**
* The first attack roll, based on D20 values.
*/
int mAttackRoll1;

/**
* The second attack roll, based on D20 values. Used for special situations.
*/
int mAttackRoll2;

/**
* The first damage roll, based on the weapon's damageDie.
*/
int mDamage1;

/**
* The second damgage roll, based on the weapon's damageDie. Used for special
* situations.
*/
int mDamage2;

/**
* The type of attack being done. (Melee or Ranged)
*/
String mAttackType;

/**
* The sum of the attack roll and modifier. (mAttack1 and mMod)
*/
int mTotal1;

/**
* The sum of the attack roll and modifier. (mAttack2 and mMod)
*/
int mTotal2;

/*
* These are widgets found in the layout.
*/
Button mCritButton;

static AttackResultFragment newInstance(int characterIndex) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
package com.example.cis.mazeminotaurs;

/**
* This serves as a container for a player's scores.
* Created by Thorin Schmidt on 3/18/2017.
*/

public class AttributeScore {

//instance variables
/**
* The score's value.
*/
int mScore;

/**
* The modifier of the score, based on the score's value.
*/
int mModifier;

/**
* The description of the score's value.
*/
String mDescription;

//private methods
Expand Down Expand Up @@ -81,20 +93,37 @@ else if(this.mScore <= 20){

//public methods

/**
* Default constructor
*
* @param score the value of the score.
*/
public AttributeScore(int score) {
this.mScore = score;
this.updateModifier();
}

/**
* Getter for the mScore property.
* @return the value of mScore.
*/
public int getScore() {
return mScore;
}

/**
* Setter for the mScore property.
* @param score the new value of mScore.
*/
public void setScore(int score) {
this.mScore = score;
this.updateModifier();
}

/**
* Getter for the mModifier property.
* @return the value of mModifier.
*/
public int getModifier() {
return mModifier;
}
Expand All @@ -104,6 +133,10 @@ public void setModifier(int modifier) {
this.modifier = modifier;
}*/

/**
* Getter for the mDescription property.
* @return the value of mDescription.
*/
public String getDescription() {
return mDescription;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,33 @@
import java.util.Random;

/**
* Created by Thorin Schmidt on 3/18/2017.
* This is a helper class for generating a valid set of AttributeScores.
* @author Thorin Schmidt on 3/18/2017.
*/

public class AttributeScoreGenerator {
//random number generator
/**
* An instance of Random for generating numbers.
*/
Random dieRoller = new Random();

//private methods
/**
* A helper method for generating a new score value.
*
* @return a score value between 8 - 18
*/
private AttributeScore nextScore(){
int rollOne = dieRoller.nextInt(6)+1;
int rollTwo = dieRoller.nextInt(6)+1;

return new AttributeScore(rollOne+rollTwo+6);
}

/**
* Returns an array of AttributeScores that are valid according to the rules
* of Mazes and Minotaurs.
* @return a valid array of AttributeScores.
*/
public AttributeScore[] nextValidSet(){

AttributeScore[] attributes = new AttributeScore[6];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,36 @@

import com.example.cis.mazeminotaurs.character.PlayerCharacter;

import java.util.ArrayList;

/**
* Created by jsmith on 10/18/17.
* This adapter is meant to display every character present in portfolio.
* @author jsmith on 10/18/17.
*/

public class CharacterAdapter extends BaseAdapter {
/**
* A reference to the Portfolio singleton.
*/
private Portfolio mPortfolio = Portfolio.get();

/**
* The context that we use to create our layout.
*/
private Context mContext;

/**
* Default constructor
*
* @param context the context to create the layout.
*/
public CharacterAdapter(Context context) {
mContext = context;
}

/**
* A helper method to remove a character based on index within the portfolio.
* This also calls {@code notifyDataSetChanged}.
* @param i the index of the character to remove
*/
public void removeCharacter(int i) {
mPortfolio.deletePlayerCharacter(mPortfolio.getPlayerCharacter(i));
notifyDataSetChanged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
import android.widget.Toast;

/**
* This is the old fragment used for deleting characters.
* @see CharacterManageActivity
* @deprecated
* Created by jsmith on 10/19/17.
*
* @author jsmith on 10/19/17.
*/

public class CharacterDeletionFragment extends Fragment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@
import com.example.cis.mazeminotaurs.fragments.CharManageFragment;
import com.example.cis.mazeminotaurs.util.CommonStrings;

/**
* This activity displays a list of characters found in the portfolio.
* The user can select one of the characters to make them active or to delete them.
* @author jsmith
*/
public class CharacterManageActivity extends AppCompatActivity implements CharManageFragment.ManagementListener {

/*
* These are the widgets found in the layout.
*/
ListViewCompat mListView;

/**
* This adapters fetches the characters from the portfolio to display in
* the list view.
*/
CharacterAdapter mAdapter;

@Override
Expand All @@ -31,8 +44,10 @@ protected void onCreate(Bundle savedInstanceState) {
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
// Opens a manage dialog where the user can select or delete.
CharManageFragment dialog = new CharManageFragment();
Bundle args = new Bundle();
// Grabs the character to use as an argument.
args.putSerializable(CommonStrings.CHARACTER_ARG.getValue(), mAdapter.getItem(i));
dialog.setListener(CharacterManageActivity.this);
dialog.setArguments(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import android.view.MenuItem;

/**
* Created by JayTSmith on 11/17/17.
* This fragment serves as a container for the character sheet and related fragments.
* The user does nothing to interact with this.
* @author jsmith on 11/17/17.
*/

public class CharacterPlayActivity extends AppCompatActivity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
import android.widget.ListView;

/**
* This is the old fragment for selecting the active character.
* @see CharacterManageActivity
* @deprecated
* Created by jsmith on 10/18/17.
*
* @author jsmith on 10/18/17.
*/

public class CharacterSelectionFragment extends Fragment {
Expand Down
Loading