Android Open Source - dexedd Pokemon






From Project

Back to project page dexedd.

License

The source code is released under:

MIT License

If you think the Android project dexedd 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

package com.nav.dexedd.model;
/* w  ww .  ja v  a 2s  .  com*/
import com.nav.dexedd.structure.Tree;

import java.util.List;

/**
 * Pokmon model.
 *
 * @author Eduardo Naveda
 * @since 0.0.1
 */
public class Pokemon {

    /**
     * Top for gender ratio calculations.
     *
     * @see com.nav.dexedd.model.Pokemon#genderRatio
     */
    private static final Double GENDER_RATIO_TOP = 8.0;

    /**
     * The Pokmon id.
     */
    private Integer id;
    /**
     * The Pokmon species id.
     */
    private Integer speciesId;
    private Integer dexNumber;
    private String name;
    private String genus;
    private String flavorText;
    private Type primaryType;
    private Type secondaryType;
    private List<Ability> abilities;
    private Double height;
    private Double weight;

    /**
     * Todo: study the catch rates and implement the formulae
     */
    private Integer catchRate;
    private List<EggGroup> eggGroups;

    /**
     * Gender ratio represents the number of females in {@link com.nav.dexedd.model.Pokemon#GENDER_RATIO_TOP GENDER_RATIO_TOP}.
     */
    private Double genderRatio;
    private Boolean catched;
    private StatSpread baseStats;
    /**
     * Describes the conditions for evolving to this Pokmon, usually zero or one, except in cases like Leafeon or
     * Glaceon where there are different ways for Eevee to achieve the evolution.
     */
    private List<EvolutionCondition> evolutionConditions;
    private Tree<Pokemon> evolutionChain;

    public Pokemon() {
    }

    public Pokemon(Integer id, Integer speciesId, String name) {
        this.id = id;
        this.speciesId = speciesId;
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getSpeciesId() {
        return speciesId;
    }

    public void setSpeciesId(Integer speciesId) {
        this.speciesId = speciesId;
    }

    public Integer getDexNumber() {
        return dexNumber;
    }

    public void setDexNumber(Integer dexNumber) {
        this.dexNumber = dexNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGenus() {
        return genus;
    }

    public void setGenus(String genus) {
        this.genus = genus;
    }

    public String getFlavorText() {
        return flavorText;
    }

    public void setFlavorText(String flavorText) {
        this.flavorText = flavorText;
    }

    public Type getPrimaryType() {
        return primaryType;
    }

    public void setPrimaryType(Type primaryType) {
        this.primaryType = primaryType;
    }

    public Type getSecondaryType() {
        return secondaryType;
    }

    public void setSecondaryType(Type secondaryType) {
        this.secondaryType = secondaryType;
    }

    public List<Ability> getAbilities() {
        return abilities;
    }

    public void setAbilities(List<Ability> abilities) {
        this.abilities = abilities;
    }

    public Double getHeight() {
        return height;
    }

    public void setHeight(Double height) {
        this.height = height;
    }

    public Double getWeight() {
        return weight;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }

    public Integer getCatchRate() {
        return catchRate;
    }

    public void setCatchRate(Integer catchRate) {
        this.catchRate = catchRate;
    }

    public List<EggGroup> getEggGroups() {
        return eggGroups;
    }

    public String getEggGroupsAsString(String separator) {
        int i = 1;
        String eggGroupsString = "";
        for (EggGroup eggGroup : eggGroups) {
            if (i < eggGroups.size()) {
                eggGroupsString = eggGroupsString + eggGroup.getName() + " " + separator + " ";
            } else {
                eggGroupsString = eggGroupsString + eggGroup.getName();
            }
            i++;
        }
        return eggGroupsString;
    }

    public void setEggGroups(List<EggGroup> eggGroups) {
        this.eggGroups = eggGroups;
    }

    public Double getGenderRatio() {
        return genderRatio / GENDER_RATIO_TOP * 100;
    }

    public void setGenderRatio(Double genderRatio) {
        this.genderRatio = genderRatio;
    }

    public StatSpread getBaseStats() {
        return baseStats;
    }

    public void setBaseStats(StatSpread baseStats) {
        this.baseStats = baseStats;
    }

    public Boolean getCatched() {
        return catched;
    }

    public void setCatched(Boolean catched) {
        this.catched = catched;
    }

    public Tree<Pokemon> getEvolutionChain() {
        return evolutionChain;
    }

    public void setEvolutionChain(Tree<Pokemon> evolutionChain) {
        this.evolutionChain = evolutionChain;
    }

    public List<EvolutionCondition> getEvolutionConditions() {
        return evolutionConditions;
    }

    public void setEvolutionConditions(List<EvolutionCondition> evolutionConditions) {
        this.evolutionConditions = evolutionConditions;
    }
}




Java Source Code List

com.nav.dexedd.activity.DexEntryActivity.java
com.nav.dexedd.activity.Dexedd.java
com.nav.dexedd.activity.MainActivity.java
com.nav.dexedd.activity.SplashActivity.java
com.nav.dexedd.adapter.DexAdapter.java
com.nav.dexedd.adapter.TreeAdapter.java
com.nav.dexedd.fragment.DatabaseInitFragment.java
com.nav.dexedd.fragment.NavigationDrawerFragment.java
com.nav.dexedd.model.Ability.java
com.nav.dexedd.model.EggGroup.java
com.nav.dexedd.model.EvolutionCondition.java
com.nav.dexedd.model.Item.java
com.nav.dexedd.model.Location.java
com.nav.dexedd.model.Move.java
com.nav.dexedd.model.Pokemon.java
com.nav.dexedd.model.Region.java
com.nav.dexedd.model.StatSpread.java
com.nav.dexedd.model.Stat.java
com.nav.dexedd.model.Type.java
com.nav.dexedd.persistence.DexDatabase.java
com.nav.dexedd.persistence.access.Access.java
com.nav.dexedd.persistence.access.DexEntry.java
com.nav.dexedd.persistence.access.Dex.java
com.nav.dexedd.structure.Tree.java
com.nav.dexedd.text.CleanClickableSpan.java
com.nav.dexedd.ui.BetterGridView.java
com.nav.dexedd.ui.BetterScrollView.java
com.nav.dexedd.ui.LabelView.java
com.nav.dexedd.ui.SquareImageView.java
com.nav.dexedd.ui.TreeLayout.java
com.nav.dexedd.ui.TypeTagView.java
com.nav.dexedd.util.AssetUtil.java
com.nav.dexedd.util.ConversionUtil.java
com.nav.dexedd.util.PokemonTextUtil.java
com.nav.dexedd.util.TypeUtil.java