Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tedla610 committed Apr 26, 2024
1 parent 39eeb11 commit fa53abe
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 6 deletions.
42 changes: 42 additions & 0 deletions app/src/main/java/com/example/proj2/Classes/Ability.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public int getRank() {
ArrayList<Double> ratioBAD = null;
ArrayList<Double> ratioAD = null;
ArrayList<Double> ratioAP = null;

public Ability(){
Name = "PlaceHolder";
this.damageType = 0;
Expand Down Expand Up @@ -262,6 +263,11 @@ public void setRatioAP(ArrayList<Double> ratioAP) {
this.ratioAP = ratioAP;
}

/**
*
* @param champ
* @return
*/
public double returnDamage(Champion champ){
Log.d("Working on Abi", Name);
Log.d("Working on Abi", String.valueOf(rank));
Expand All @@ -276,6 +282,12 @@ public double returnDamage(Champion champ){
}
return 0;
}

/**
*
* @param champ
* @return
*/
public double returnADDamage(Champion champ){
Log.d("Working on Abi", Name);
Log.d("Working on Abi", String.valueOf(rank));
Expand All @@ -290,6 +302,12 @@ public double returnADDamage(Champion champ){
}
return 0;
}

/**
*
* @param champ
* @return
*/
public double returnAPDamage(Champion champ){
Log.d("Working on Abi", Name);
Log.d("Working on Abi", String.valueOf(rank));
Expand All @@ -304,6 +322,12 @@ public double returnAPDamage(Champion champ){
}
return 0;
}

/**
*
* @param champ
* @return
*/
public double returnTrueDamage(Champion champ){
Log.d("Working on Abi", Name);
Log.d("Working on Abi", String.valueOf(rank));
Expand All @@ -318,18 +342,36 @@ public double returnTrueDamage(Champion champ){
}
return 0;
}

/**
*
* @param champ
* @return
*/
public double returnDOT(Champion champ){
if(isDOT == true){
return dotDamage.get(rank-1)*duration/perSecond;
}
return 0;
}

/**
*
* @param champ
* @return
*/
public double returnMaxHPDOT(Champion champ){
if(isMaxHP == true){
return dotDamage.get(rank-1)*duration/perSecond;
}
return 0;
}

/**
*
* @param champ
* @return
*/
public double returnSummonDamage(Champion champ){
if(isSummon == true){
return summonAA.get(rank-1);
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/java/com/example/proj2/Classes/Champion.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ public double getAttackSpeedPerLevel() {
return attackSpeedPerLevel;
}

/**
* returnCombineDamage
* @return
*/
public double returnCombineDamage(){
double qDamage = abilities.get(0).returnDamage(this);
double wDamage = abilities.get(1).returnDamage(this);
Expand All @@ -242,6 +246,11 @@ public double returnCombineDamage(){
//Log.d("Combine Dmg" ,String.valueOf(getBaseDamage() + qDamage + wDamage + eDamage+ rDamage));
return getBaseDamage()+ getDamagePerLevel()* getLevel() + qDamage + wDamage + eDamage+ rDamage;
}

/**
* returnADDamage
* @return
*/
public double returnADDamage(){
double qDamage = abilities.get(0).returnADDamage(this);
double wDamage = abilities.get(1).returnADDamage(this);
Expand All @@ -258,6 +267,11 @@ public double returnAPDamage(){
//Log.d("AP Dmg" ,String.valueOf(getBaseDamage() + qDamage + wDamage + eDamage+ rDamage));
return qDamage + wDamage + eDamage+ rDamage;
}

/**
* returnTrueDamage
* @return
*/
public double returnTrueDamage(){
double qDamage = abilities.get(0).returnAPDamage(this);
double wDamage = abilities.get(1).returnAPDamage(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ enum qwer{Qability,Wability,Eability,Rability};
public LiveData<Champion> getChampion() {
return championData;
}

/**
*
* @param context
* @param championName
*/
public void fetchChampionData(Context context, String championName) {
if (queue == null) {
queue = Volley.newRequestQueue(context);
Expand Down
16 changes: 12 additions & 4 deletions app/src/main/java/com/example/proj2/FirstFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
import com.example.proj2.databinding.FragmentFirstBinding;
import com.google.firebase.firestore.FirebaseFirestore;

// Defining the FirstFragment class that extends Fragment
/**
* Defining the FirstFragment class that extends Fragment
*/
public class FirstFragment extends Fragment {
private static final String TAG = FirstFragment.class.getSimpleName(); // TAG for logging

Expand All @@ -28,7 +30,12 @@ public View onCreateView(
return binding.getRoot();
}

// Method called after the view has been created
/**
*
* @param view The View returned by {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}.
* @param savedInstanceState If non-null, this fragment is being re-constructed
* from a previous saved state as given here.
*/
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);

Expand All @@ -47,8 +54,9 @@ public void onClick(View view) {
Navigation.findNavController(view).navigate(R.id.action_FirstFragment_to_SecondFragment, result);
}
});

// Similar click listeners for other champion buttons
/**
* Similar click listeners for other champion buttons
*/
// Garen
view.findViewById(R.id.GarenButton2).setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.FirebaseFirestore;

// Defining the ItemSelectionActivity class that extends AppCompatActivity
/**
* Defining the ItemSelectionActivity class that extends AppCompatActivity
*/
public class ItemSelectionActivity extends AppCompatActivity {

// Initialize Firestore database reference
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/example/proj2/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;


/**
* Extended LoginActivity Class
*/
public class LoginActivity extends AppCompatActivity {
private FirebaseAuth mFirebaseAuth;
private DatabaseReference mDatabaseRef;
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/example/proj2/RegisterActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;

/**
* RegisterActivity extends
*/
public class RegisterActivity extends AppCompatActivity {

private FirebaseAuth mFirebaseAuth;
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/example/proj2/SecondFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import com.example.proj2.Classes.ItemViewModel;
import com.example.proj2.databinding.FragmentSecondBinding;

/**
* Defining the SecondFragment class that extends Fragment
*/
public class SecondFragment extends Fragment {

private FragmentSecondBinding binding;
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/example/proj2/UserAccount.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.example.proj2; // Package declaration indicating the location of the class

/**
* UserAccount Class
*/
public class UserAccount {
private String emailId; // Private field to store the user's email ID
private String password; // Private field to store the user's password
Expand Down

0 comments on commit fa53abe

Please sign in to comment.