Android Open Source - MythTrack Myth Track Contract






From Project

Back to project page MythTrack.

License

The source code is released under:

MIT License

If you think the Android project MythTrack listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * MythTrackContract is a contract class for the MythTrackDatabase provider.
 *// www  .  j  av a2 s.  c  o  m
 * @author Nolan Jurgens
 */

package nolanjurgens.mythtrack.provider;

// IMPORTS /////////////////////////////////////////////////////////////////////////////////////////
import android.content.ContentResolver;
import android.net.Uri;
import android.provider.BaseColumns;

////////////////////////////////////////////////////////////////////////////////////////////////////
// CLASS - MythTrackContract                                                                      //
////////////////////////////////////////////////////////////////////////////////////////////////////
public final class MythTrackContract
{
  // CONSTANTS /////////////////////////////////////////////////////////////////////////////////////

  /** The MythTrack provider authority*/
  public static final String AUTHORITY = "nolanjurgens.mythtrack.provider";
  /** The URI for the top level of the content provider.*/
  public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY);

  //////////////////////////////////////////////////////////////////////////////////////////////////
  // SUBCLASS - MythTrackContract.Heroes                                                          //
  //////////////////////////////////////////////////////////////////////////////////////////////////
  public static abstract class Heroes implements BaseColumns
  {
    // CONSTANTS ///////////////////////////////////////////////////////////////////////////////////

    // The table and column names.
    /** The name of the table.*/
    public static final String TABLE = "heroes";
    /** Column containing hero names. (Strings)*/
    public static final String COLUMN_NAME = "name";
    /** Column containing hero class identifiers. (Integers)*/
    public static final String COLUMN_CLASS_ID = "class_id";
    /** Column containing hero attribute identifiers. (Integers)*/
    public static final String COLUMN_ATTRIBUTE = "attribute_id";
    /** Column containing hero base movement points. (Integers)*/
    public static final String COLUMN_MOVEMENT = "movement";
    /** Column containing hero base vitalities. (Integers)*/
    public static final String COLUMN_BASE_VITALITY = "base_vitality";
    /** Column containing hero base courage points. (Integers)*/
    public static final String COLUMN_COURAGE = "courage";
    /** Column containing hero threat levels. (Integers)*/
    public static final String COLUMN_THREAT = "threat";
    /** Column containing hero current vitalities. (Integers)*/
    public static final String COLUMN_VITALITY = "vitality";
    /** Column containing hero gold amounts. (Integers)*/
    public static final String COLUMN_GOLD = "gold";
    /** Column containing hero serendipity amounts. (Integers)*/
    public static final String COLUMN_SERENDIPITY = "serendipity";
    /** Column containing hero equipped primary IDs. (Integers)*/
    public static final String COLUMN_PRIMARY = "primary_id";
    /** Column containing hero equipped secondary IDs. (Integers)*/
    public static final String COLUMN_SECONDARY = "secondary_id";
    /** Column containing hero equipped armor IDs. (Integers)*/
    public static final String COLUMN_ARMOR = "armor_id";
    /** Column containing hero equipped helm IDs. (Integers)*/
    public static final String COLUMN_HELM = "helm_id";
    /** Column containing hero equipped accessory IDs. (Integers)*/
    public static final String COLUMN_ACCESSORY = "accessory_id";
    /** Column containing hero equipped title IDs. (Integers)*/
    public static final String COLUMN_TITLE = "title_id";
    /** Column containing hero status effects. (Integers)*/
    public static final String COLUMN_STATUS_EFFECTS = "status_effects";

    /** The URI for the Heroes table.*/
    public static final Uri CONTENT_URI = Uri.withAppendedPath(MythTrackContract.CONTENT_URI,
      Heroes.TABLE);
    /** The MIME type for multiple records.*/
    public static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE +
      "/" + AUTHORITY + "." + TABLE;
    /** The MIME type for a single record.*/
    public static final String CONTENT_RECORD_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE +
      "/" + AUTHORITY + "." + TABLE;

    // Class IDs
    /** Acolyte class ID.*/
    public static final int ACOLYTE = 1;
    /** Apprentice class ID.*/
    public static final int APPRENTICE = 2;
    /** Archer class ID.*/
    public static final int ARCHER = 3;
    /** Brigand class ID.*/
    public static final int BRIGAND = 4;
    /** Soldier class ID.*/
    public static final int SOLDIER = 5;
    /** Druid class ID.*/
    public static final int DRUID = 6;
    /** Skald class ID.*/
    public static final int SKALD = 7;
    /** Spriggan class ID.*/
    public static final int SPRIGGAN = 8;
    /** Trickster class ID.*/
    public static final int TRICKSTER = 9;
    /** Hunter class ID.*/
    public static final int HUNTER = 10;

    // Attribute IDs
    /** Arcane attribute. (Apprentice)*/
    public static final int ARCANE = 1;
    /** Darkness attribute.*/
    public static final int DARKNESS = 2;
    /** Faith attribute. (Acolyte, Skald)*/
    public static final int FAITH = 3;
    /** Guile attribute. (Brigand, Trickster)*/
    public static final int GUILE = 4;
    /** Nature attribute. (Archer, Druid/Spriggan)*/
    public static final int NATURE = 5;
    /** Rage attribute. (Soldier)*/
    public static final int RAGE = 6;

    // Status Effect Bits
    /** Poison.*/
    public static final int POISONED = 1;
    /** Cursed.*/
    public static final int CURSED = 2;
    /** Prone.*/
    public static final int PRONE = 4;
    /** Frozen.*/
    public static final int FROZEN = 8;
    /** Capture.*/
    public static final int CAPTURED = 16;

    /** A projection of relevant columns for the hero list.*/
    public static final String[] PROJECTION_LIST = {_ID, COLUMN_NAME, COLUMN_CLASS_ID};

    /** A projection of relevant columns for the loading the hero.*/
    public static final String[] PROJECTION_LOAD = {_ID, COLUMN_NAME, COLUMN_CLASS_ID,
      COLUMN_ATTRIBUTE, COLUMN_MOVEMENT, COLUMN_BASE_VITALITY, COLUMN_COURAGE, COLUMN_THREAT,
      COLUMN_VITALITY, COLUMN_GOLD, COLUMN_SERENDIPITY, COLUMN_PRIMARY, COLUMN_SECONDARY,
      COLUMN_ARMOR, COLUMN_HELM, COLUMN_ACCESSORY, COLUMN_TITLE, COLUMN_STATUS_EFFECTS};

    /** The default sort order (alphabetical by hero name).*/
    public static final String SORT_ORDER_NAME = COLUMN_NAME + " ASC";
  }


  //////////////////////////////////////////////////////////////////////////////////////////////////
  // SUBCLASS - MythTrackContract.Items                                                           //
  //////////////////////////////////////////////////////////////////////////////////////////////////
  public static abstract class Items implements BaseColumns
  {
    // CONSTANTS ///////////////////////////////////////////////////////////////////////////////////

    // The table and column names.
    /** The name of the table.*/
    public static final String TABLE = "items";
    /** Column containing item names. (Strings)*/
    public static final String COLUMN_NAME = "name";
    /** Column containing item source identifiers. (Integers)*/
    public static final String COLUMN_SOURCE = "source";
    /** Column containing item type identifiers. (Integers)*/
    public static final String COLUMN_TYPE = "type";
    /** Column containing item rarity identifiers. (Integers)*/
    public static final String COLUMN_RARITY = "rarity";
    /** Column containing item caster identifiers. (Integers)*/
    public static final String COLUMN_CASTING = "casting";
    /** Column containing item ranges. (Integers)*/
    public static final String COLUMN_RANGE = "range";
    /** Column containing item buy costs. (Integers)*/
    public static final String COLUMN_BUY = "buy";
    /** Column containing item sell values. (Integers)*/
    public static final String COLUMN_SELL = "sell";
    /** Column containing item hit dice modifiers. (Integers)*/
    public static final String COLUMN_HIT_DICE = "hit_dice";
    /** Column containing item fate dice modifiers. (Integers)*/
    public static final String COLUMN_FATE_DICE = "fate_dice";
    /** Column containing item offensive target number modifiers. (Integers)*/
    public static final String COLUMN_OFFENSE = "offense";
    /** Column containing item defensive target number modifiers. (Integers)*/
    public static final String COLUMN_DEFENSE = "defense";
    /** Column containing item movement point modifiers. (Integers)*/
    public static final String COLUMN_MOVEMENT_POINTS = "movement_points";
    /** Column containing item cautious movement modifiers. (Integers)*/
    public static final String COLUMN_CAUTIOUS_MOVEMENT = "cautious_movement";
    /** Column containing item non-combat action modifiers. (Integers)*/
    public static final String COLUMN_NON_COMBAT_ACTION = "non_combat_action";
    /** Column containing item courage modifiers. (Integers)*/
    public static final String COLUMN_COURAGE = "courage";
    /** Column containing item minimum threat modifiers. (Integers)*/
    public static final String COLUMN_MIN_THREAT = "min_threat";
    /** Column containing item minimum threat modifiers. (Integers)*/
    public static final String COLUMN_MAX_THREAT = "max_threat";
    /** Column containing item vitality modifiers. (Integers)*/
    public static final String COLUMN_VITALITY = "vitality";
    /** Column containing item faith modifiers. (Integers)*/
    public static final String COLUMN_FAITH = "faith";
    /** Column containing item ammo capacity. (Integers)*/
    public static final String COLUMN_AMMO = "ammo";
    /** Column containing item verses capability. (Integers)*/
    public static final String COLUMN_VERSES = "verses";
    /** Column containing item rage modifiers. (Integers)*/
    public static final String COLUMN_RAGE = "rage";
    /** Column containing item essence values. (Integers)*/
    public static final String COLUMN_ESSENCE = "essence";
    /** Column containing item durability values. (Integers)*/
    public static final String COLUMN_DURABILITY = "durability";
    /** Column containing item parts capacity. (Integers)*/
    public static final String COLUMN_PARTS = "parts";
    /** Column containing potion type identifiers. (Integers)*/
    public static final String COLUMN_POTION = "potion_id";
    /** Column containing item status effects immunities. (Integers)*/
    public static final String COLUMN_IMMUNITIES = "immunities";


    /** The URI for the Items table.*/
    public static final Uri CONTENT_URI = Uri.withAppendedPath(MythTrackContract.CONTENT_URI,
      Items.TABLE);
    /** The MIME type for multiple records.*/
    public static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE +
      "/" + AUTHORITY + "." + TABLE;
    /** The MIME type for a single record.*/
    public static final String CONTENT_RECORD_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE +
      "/" + AUTHORITY + "." + TABLE;

    // Source IDs
    /** Item is from the base game.*/
    public static final int BASE_GAME = 1;
    /** Item is from the "Fury of the Fireborne".*/
    public static final int FIREBORNE = 2;
    /** Item is from the Trickster.*/
    public static final int TRICKSTER = 3;
    /** Item is from the Skald.*/
    public static final int SKALD = 4;
    /** Item is from the Spriggan/Druid.*/
    public static final int SPRIGGAN = 5;
    /** Item is from the Twilight Knight.*/
    public static final int TWILIGHT_KNIGHT = 6;
    /** Item is from item expansion 1.*/
    public static final int ITEM_EXPANSION_1 = 7;
    /** Item is from the Slaughterfield supplement.*/
    public static final int SLAUGHTERFIELD = 8;


    // Type IDs
    /** Primary type ID.*/
    public static final int PRIMARY = 1;
    /** Two-Handed type ID.*/
    public static final int TWO_HANDED = 2;
    /** Secondary type ID.*/
    public static final int SECONDARY = 3;
    /** Armor type ID.*/
    public static final int ARMOR = 4;
    /** Helm type ID.*/
    public static final int HELM = 5;
    /** Accessory type ID.*/
    public static final int ACCESSORY = 6;
    /** Potion type ID.*/
    public static final int POTION = 7;

    // Rarity IDs
    /** White rarity ID.*/
    public static final int WHITE = 1;
    /** Brown rarity ID.*/
    public static final int BROWN = 2;
    /** Green rarity ID.*/
    public static final int GREEN = 3;
    /** Blue rarity ID.*/
    public static final int BLUE = 4;
    /** Yellow rarity ID.*/
    public static final int YELLOW = 5;
    /** Orange rarity ID.*/
    public static final int ORANGE = 6;
    /** Red rarity ID.*/
    public static final int RED = 7;

    // Casting IDs
    /** Relic ID.*/
    public static final int RELIC = 1;
    /** Focus ID.*/
    public static final int FOCUS = 2;
    /** Instrument ID.*/
    public static final int INSTRUMENT = 3;

    // Potion IDs
    /** Anti-venom potion ID.*/
    public static final int ANTI_VENOM_POTION = 1;
    /** Focus potion ID.*/
    public static final int FOCUS_POTION = 2;
    /** Vitality potion ID.*/
    public static final int VITALITY_POTION = 3;
    /** Lucky potion ID.*/
    public static final int LUCKY_POTION = 4;
    /** Major vitality potion ID.*/
    public static final int MAJOR_VITALITY_POTION = 5;
    /** Shadow potion ID.*/
    public static final int SHADOW_POTION = 6;

    // Immunity Bits
    /** Immune to poison.*/
    public static final int POISONED = 1;
    /** Immune to curses.*/
    public static final int CURSED = 2;
    /** Immune to getting knocked prone.*/
    public static final int PRONE = 4;
    /** Immune to being frozen.*/
    public static final int FROZEN = 8;
    /** Immune to capture.*/
    public static final int CAPTURED = 16;


    /** A projection of relevant columns for the item list.*/
    public static final String[] PROJECTION_LIST = {_ID, COLUMN_NAME, COLUMN_TYPE,
      Items.COLUMN_RARITY};

    /** A projection of relevant columns for the loading a item.*/
    public static final String[] PROJECTION_LOAD = {_ID, COLUMN_NAME, COLUMN_TYPE, COLUMN_RARITY,
      COLUMN_CASTING, COLUMN_RANGE, COLUMN_BUY, COLUMN_SELL, COLUMN_HIT_DICE, COLUMN_FATE_DICE,
      COLUMN_OFFENSE, COLUMN_DEFENSE, COLUMN_MOVEMENT_POINTS, COLUMN_CAUTIOUS_MOVEMENT,
      COLUMN_NON_COMBAT_ACTION, COLUMN_COURAGE, COLUMN_MIN_THREAT, COLUMN_MAX_THREAT,
      COLUMN_VITALITY, COLUMN_FAITH, COLUMN_AMMO, COLUMN_VERSES, COLUMN_RAGE, COLUMN_ESSENCE,
      COLUMN_DURABILITY, COLUMN_PARTS, COLUMN_POTION, COLUMN_IMMUNITIES};

    /** A projection of relevant columns for finding starting gear.*/
    public static final String[] PROJECTION_STARTING_GEAR = {_ID, COLUMN_NAME, COLUMN_RARITY};
    /** A selection for finding starting gear.*/
    public static final String SELECTION_STARTING_GEAR = COLUMN_RARITY + " = " + BROWN;

    /** A projection of relevant columns for checking if an item exists and should be updated.*/
    public static final String[] PROJECTION_UPDATE_CHECK = {_ID, COLUMN_NAME};

    /** Sort by rarity, then name. (Default)*/
    public static final String SORT_ORDER_RARITY = COLUMN_RARITY + " ASC, " + COLUMN_NAME + " ASC";

  }


  //////////////////////////////////////////////////////////////////////////////////////////////////
  // SUBCLASS - MythTrackContract.Inventories                                                     //
  //////////////////////////////////////////////////////////////////////////////////////////////////
  public static abstract class Inventories implements BaseColumns
  {
    // CONSTANTS ///////////////////////////////////////////////////////////////////////////////////

    // The table and column names.
    /** The name of the table.*/
    public static final String TABLE = "inventories";
    /** Column containing hero IDs. (Integers)*/
    public static final String COLUMN_HERO_ID = "hero_id";
    /** Column containing item IDs. (Integers)*/
    public static final String COLUMN_ITEM_ID = "item_id";

    // Column alias names.
    /** Alias for Items._ID*/
    public static final String ALIAS_ITEMS_ID = "item_table_id";

    /** The URI for the Inventories table.*/
    public static final Uri CONTENT_URI = Uri.withAppendedPath(MythTrackContract.CONTENT_URI,
      Inventories.TABLE);
    /** The MIME type for multiple records.*/
    public static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE +
      "/" + AUTHORITY + "." + TABLE;
    /** The MIME type for a single record.*/
    public static final String CONTENT_RECORD_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE +
      "/" + AUTHORITY + "." + TABLE;

    /** A projection of relevant columns for the inventory list.*/
    public static final String[] PROJECTION_LIST = {Inventories.TABLE + "." + Inventories._ID,
      Inventories.COLUMN_ITEM_ID, Inventories.COLUMN_HERO_ID, Items.TABLE + "." + Items._ID + " AS "
      + ALIAS_ITEMS_ID,  Items.COLUMN_NAME, Items.COLUMN_TYPE, Items.COLUMN_POTION};

    /** A projection of relevant columns for loading an item*/
    public static final String[] PROJECTION_ITEM_LOAD = {Inventories.TABLE + "." + _ID,
      Inventories.COLUMN_ITEM_ID};

    /** Sort by name only.*/
    public static final String SORT_ORDER_NAME = Items.COLUMN_NAME + " ASC";
  }


  //////////////////////////////////////////////////////////////////////////////////////////////////
  // SUBCLASS - MythTrackContract.Titles                                                          //
  //////////////////////////////////////////////////////////////////////////////////////////////////
  public static abstract class Titles implements BaseColumns
  {
    // CONSTANTS ///////////////////////////////////////////////////////////////////////////////////

    // The table and column names.
    /** The name of the table.*/
    public static final String TABLE = "titles";
    /** Column containing title names. (Strings)*/
    public static final String COLUMN_NAME = "name";
    /** Column containing title descriptions. (Strings)*/
    public static final String COLUMN_DESCRIPTION = "description";
    /** Column containing item movement point modifiers. (Integers)*/
    public static final String COLUMN_MOVEMENT_POINTS = "movement_points";
    /** Column containing item non-combat action modifiers. (Integers)*/
    public static final String COLUMN_NON_COMBAT_ACTION = "non_combat_action";
    /** Column containing item vitality modifiers. (Integers)*/
    public static final String COLUMN_VITALITY = "vitality";
    /** Column containing item status effects immunities. (Integers)*/
    public static final String COLUMN_IMMUNITIES = "immunities";


    /** The URI for the Heroes table.*/
    public static final Uri CONTENT_URI = Uri.withAppendedPath(MythTrackContract.CONTENT_URI,
      Titles.TABLE);
    /** The MIME type for multiple records.*/
    public static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE +
      "/" + AUTHORITY + "." + TABLE;
    /** The MIME type for a single record.*/
    public static final String CONTENT_RECORD_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE +
      "/" + AUTHORITY + "." + TABLE;

    /** A projection of relevant columns for the title list.*/
    public static final String[] PROJECTION_LIST = {_ID, COLUMN_NAME};

    /** A projection of relevant columns for loading a title*/
    public static final String[] PROJECTION_LOAD = {_ID, COLUMN_NAME, COLUMN_DESCRIPTION,
      COLUMN_MOVEMENT_POINTS, COLUMN_NON_COMBAT_ACTION, COLUMN_VITALITY, COLUMN_IMMUNITIES};

    /** A projection of relevant columns for checking if a title exists and should be updated.*/
    public static final String[] PROJECTION_UPDATE_CHECK = {_ID, COLUMN_NAME};

    /** Sort by name only.*/
    public static final String SORT_ORDER_NAME = Items.COLUMN_NAME + " ASC";
  }
}




Java Source Code List

nolanjurgens.mythtrack.app.BuyItemDialog.java
nolanjurgens.mythtrack.app.CreateHeroDialog.java
nolanjurgens.mythtrack.app.DeleteHeroDialog.java
nolanjurgens.mythtrack.app.EquipmentInfoDialog.java
nolanjurgens.mythtrack.app.HeroDisplayFragment.java
nolanjurgens.mythtrack.app.HeroHelper.java
nolanjurgens.mythtrack.app.HeroList.java
nolanjurgens.mythtrack.app.HeroTrackerActivity.java
nolanjurgens.mythtrack.app.Hero.java
nolanjurgens.mythtrack.app.InventoryList.java
nolanjurgens.mythtrack.app.ItemHelper.java
nolanjurgens.mythtrack.app.ItemList.java
nolanjurgens.mythtrack.app.Item.java
nolanjurgens.mythtrack.app.MainActivity.java
nolanjurgens.mythtrack.app.RemoveItemDialog.java
nolanjurgens.mythtrack.app.SettingsActivity.java
nolanjurgens.mythtrack.app.SettingsFragment.java
nolanjurgens.mythtrack.app.StatInfoDialog.java
nolanjurgens.mythtrack.app.StatPickerDialog.java
nolanjurgens.mythtrack.app.TitleHelper.java
nolanjurgens.mythtrack.app.Title.java
nolanjurgens.mythtrack.provider.MythTrackBackup.java
nolanjurgens.mythtrack.provider.MythTrackContract.java
nolanjurgens.mythtrack.provider.MythTrackDatabase.java