forked from gatheringhallstudios/MHGenDatabase
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50a08b5
commit 3b13dd3
Showing
67 changed files
with
1,255 additions
and
478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
139 changes: 139 additions & 0 deletions
139
app/src/main/java/com/ghstudios/android/data/classes/PalicoWeapon.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
package com.ghstudios.android.data.classes; | ||
|
||
/** | ||
* Created by Joseph on 7/9/2016. | ||
*/ | ||
public class PalicoWeapon { | ||
private long _id; | ||
private int attackMelee; | ||
private int attackRanged; | ||
private boolean blunt; | ||
private int balance; | ||
private int elementMelee; | ||
private int elementRanged; | ||
private String element; | ||
private int affinityMelee; | ||
private int affinityRanged; | ||
private int defense; | ||
private int creation_cost; | ||
int sharpness; | ||
Item item; | ||
|
||
public Item getItem(){ | ||
return this.item; | ||
} | ||
|
||
public void setItem(Item i){item=i;} | ||
|
||
public int getSharpness() { | ||
return sharpness; | ||
} | ||
|
||
public void setSharpness(int sharpness) { | ||
this.sharpness = sharpness; | ||
} | ||
|
||
|
||
public long getId() { | ||
return _id; | ||
} | ||
|
||
public void setId(long _id) { | ||
this._id = _id; | ||
} | ||
|
||
public int getAttackMelee() { | ||
return attackMelee; | ||
} | ||
|
||
public void setAttackMelee(int attackMelee) { | ||
this.attackMelee = attackMelee; | ||
} | ||
|
||
public int getAttackRanged() { | ||
return attackRanged; | ||
} | ||
|
||
public void setAttackRanged(int attackRanged) { | ||
this.attackRanged = attackRanged; | ||
} | ||
|
||
public boolean isBlunt() { | ||
return blunt; | ||
} | ||
|
||
public void setBlunt(boolean blunt) { | ||
this.blunt = blunt; | ||
} | ||
|
||
public int getBalance() { | ||
return balance; | ||
} | ||
|
||
public String getBalanceString(){ | ||
switch (balance){ | ||
case 0:return "[Balanced]"; | ||
case 1:return "[Melee+]"; | ||
default:return "[Boomerang+]"; | ||
} | ||
} | ||
public void setBalance(int balance) { | ||
this.balance = balance; | ||
} | ||
|
||
public int getElementMelee() { | ||
return elementMelee; | ||
} | ||
|
||
public void setElementMelee(int elementMelee) { | ||
this.elementMelee = elementMelee; | ||
} | ||
|
||
public int getElementRanged() { | ||
return elementRanged; | ||
} | ||
|
||
public void setElementRanged(int elementRanged) { | ||
this.elementRanged = elementRanged; | ||
} | ||
|
||
public String getElement() { | ||
return element; | ||
} | ||
|
||
public void setElement(String element) { | ||
this.element = element; | ||
} | ||
|
||
public int getAffinityMelee() { | ||
return affinityMelee; | ||
} | ||
|
||
public void setAffinityMelee(int affinityMelee) { | ||
this.affinityMelee = affinityMelee; | ||
} | ||
|
||
public int getAffinityRanged() { | ||
return affinityRanged; | ||
} | ||
|
||
public void setAffinityRanged(int affinityRanged) { | ||
this.affinityRanged = affinityRanged; | ||
} | ||
|
||
public int getDefense() { | ||
return defense; | ||
} | ||
|
||
public void setDefense(int defense) { | ||
this.defense = defense; | ||
} | ||
|
||
public int getCreation_cost() { | ||
return creation_cost; | ||
} | ||
|
||
public void setCreation_cost(int creation_cost) { | ||
this.creation_cost = creation_cost; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
app/src/main/java/com/ghstudios/android/data/database/PalicoWeaponCursor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.ghstudios.android.data.database; | ||
|
||
import android.database.Cursor; | ||
import android.database.CursorWrapper; | ||
|
||
import com.ghstudios.android.data.classes.Item; | ||
import com.ghstudios.android.data.classes.PalicoWeapon; | ||
|
||
/** | ||
* Created by Joseph on 7/9/2016. | ||
*/ | ||
public class PalicoWeaponCursor extends CursorWrapper { | ||
|
||
public PalicoWeaponCursor(Cursor cursor) { | ||
super(cursor); | ||
} | ||
|
||
public PalicoWeapon getWeapon(){ | ||
if (isBeforeFirst() || isAfterLast()) | ||
return null; | ||
|
||
PalicoWeapon weapon = new PalicoWeapon(); | ||
weapon.setId(getLong(getColumnIndex(S.COLUMN_PALICO_WEAPONS_ID))); | ||
weapon.setCreation_cost(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_CREATION_COST))); | ||
weapon.setAttackMelee(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_ATTACK_MELEE))); | ||
weapon.setAttackRanged(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_ATTACK_RANGED))); | ||
weapon.setElement(getString(getColumnIndex(S.COLUMN_PALICO_WEAPONS_ELEMENT))); | ||
weapon.setElementMelee(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_ELEMENT_MELEE))); | ||
weapon.setElementRanged(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_ELEMENT_RANGED))); | ||
weapon.setDefense(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_DEFENSE))); | ||
weapon.setSharpness(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_SHARPNESS))); | ||
weapon.setAffinityMelee(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_AFFINITY_MELEE))); | ||
weapon.setAffinityRanged(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_AFFINITY_RANGED))); | ||
weapon.setBlunt(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_BLUNT))==1); | ||
weapon.setBalance(getInt(getColumnIndex(S.COLUMN_PALICO_WEAPONS_BALANCE))); | ||
|
||
Item i = new Item(); | ||
i.setId(getLong(getColumnIndex(S.COLUMN_ITEMS_ID))); | ||
i.setName(getString(getColumnIndex(S.COLUMN_ITEMS_NAME))); | ||
i.setRarity(getInt(getColumnIndex(S.COLUMN_ITEMS_RARITY))); | ||
i.setDescription(getString(getColumnIndex(S.COLUMN_ITEMS_DESCRIPTION))); | ||
i.setFileLocation(getString(getColumnIndex(S.COLUMN_ITEMS_ICON_NAME))); | ||
|
||
weapon.setItem(i); | ||
return weapon; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/ghstudios/android/loader/PalicoWeaponListCursorLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.ghstudios.android.loader; | ||
|
||
import android.content.Context; | ||
import android.database.Cursor; | ||
|
||
import com.ghstudios.android.data.database.DataManager; | ||
import com.ghstudios.android.data.database.PalicoWeaponCursor; | ||
|
||
/** | ||
* Created by Joseph on 7/10/2016. | ||
*/ | ||
public class PalicoWeaponListCursorLoader extends SQLiteCursorLoader { | ||
|
||
public PalicoWeaponListCursorLoader(Context context) { | ||
super(context); | ||
} | ||
|
||
@Override | ||
protected Cursor loadCursor() { | ||
PalicoWeaponCursor cursor = DataManager.get(getContext()).queryPalicoWeapons(); | ||
return cursor; | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/ghstudios/android/ui/ClickListeners/PalicoWeaponClickListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.ghstudios.android.ui.ClickListeners; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.view.View; | ||
|
||
import com.ghstudios.android.ui.detail.PalicoWeaponDetailActivity; | ||
|
||
/** | ||
* Created by Joseph on 7/10/2016. | ||
*/ | ||
public class PalicoWeaponClickListener implements View.OnClickListener { | ||
private Context c; | ||
private Long id; | ||
|
||
public PalicoWeaponClickListener(Context context, Long id) { | ||
super(); | ||
this.id = id; | ||
this.c = context; | ||
} | ||
|
||
@Override | ||
public void onClick(View v) { | ||
Intent i = new Intent(c, PalicoWeaponDetailActivity.class); | ||
i.putExtra(PalicoWeaponDetailActivity.EXTRA_WEAPON_ID, id); | ||
c.startActivity(i); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.