package com.sheep.gamegroup.model.entity;

import com.sheep.gamegroup.helper.DownloadHelper;
import com.sheep.gamegroup.helper.FindAppHelper;
import com.sheep.gamegroup.model.api.IDownload;

import java.io.Serializable;
import java.util.List;

/**
 * Created by realicing on 2018/6/28.
 * realicing@sina.com
 */
public class Applications implements IDownload, Serializable {
    private int updated_at;

    private float score;//评分

    private String download_url;//下载地址

    private String package_size;//包d大小单位M

    private int Id;

    private String versions;//版本号

    private String pictures;//宣传图标（分号隔开）

    private String package_name;//应用包名称

    private int platform;//平台 0：全 1：安卓 2：IOS

    private int status;//1:开启 2：关闭

    private String icon;//应用图标

    private String name;//应用名称

    private int created_at;

    private String intro;//应用简介

    private int download_at;//预约下载开放时间

    private String manufacturer;//厂商

    private String main_publicize;//主宣传图（视频）

    private int score_count;//评分人数

    private int download_type;//1：非预约下载 2：预约下载

    private int download_count;//下载数量

    private int download;//1：可以下载

    private int record;//1：可记录 其他：不可记录
    private int receive_account = 1;//integer($int64)0:未领取账号 1:已领取账号
    private int available_receive = 1;//0:可领取账号 1:不可领取账号

    private String type;
    private String package_id;

    private int package_type;

    private int download_count_increment;


    private int is_recommend;

    private List<GameListTag> tags;

    private String ext_detail;

    private int sort;

    private int IsPlay;

    private int IsHot;
    //总评论数
    private int comment_num;

    public int getAvailable_receive() {
        return available_receive;
    }

    public void setAvailable_receive(int available_receive) {
        this.available_receive = available_receive;
    }

    public int getReceive_account() {
        return receive_account;
    }

    public void setReceive_account(int receive_account) {
        this.receive_account = receive_account;
    }

    public void setUpdated_at(int updated_at) {
        this.updated_at = updated_at;
    }

    public int getUpdated_at() {
        return this.updated_at;
    }

    public void setScore(float score) {
        this.score = score;
    }

    public float getScore() {
        return this.score;
    }

    public void setDownload_url(String download_url) {
        this.download_url = download_url;
    }

    public String getDownload_url() {
        return this.download_url;
    }

    public void setPackage_size(String package_size) {
        this.package_size = package_size;
    }

    public String getPackage_size() {
        return this.package_size;
    }

    public void setId(int Id) {
        this.Id = Id;
    }

    public int getId() {
        return this.Id;
    }

    public void setVersions(String versions) {
        this.versions = versions;
    }

    public String getVersions() {
        return this.versions;
    }

    public void setPictures(String pictures) {
        this.pictures = pictures;
    }

    public String getPictures() {
        return this.pictures;
    }

    public void setPackage_name(String package_name) {
        this.package_name = package_name;
    }

    public String getPackage_name() {
        return this.package_name;
    }

    public void setPlatform(int platform) {
        this.platform = platform;
    }

    public int getPlatform() {
        return this.platform;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getStatus() {
        return this.status;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getIcon() {
        return this.icon;
    }

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

    public String getName() {
        return this.name;
    }

    public void setCreated_at(int created_at) {
        this.created_at = created_at;
    }

    public int getCreated_at() {
        return this.created_at;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public String getIntro() {
        return this.intro;
    }

    public void setDownload_at(int download_at) {
        this.download_at = download_at;
    }

    public int getDownload_at() {
        return this.download_at;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public String getManufacturer() {
        return this.manufacturer;
    }

    public void setScore_count(int score_count) {
        this.score_count = score_count;
    }

    public int getScore_count() {
        return this.score_count;
    }

    public void setDownload_type(int download_type) {
        this.download_type = download_type;
    }

    public int getDownload_type() {
        return this.download_type;
    }

    public void setDownload_count(int download_count) {
        this.download_count = download_count;
    }

    public int getDownload_count() {
        return this.download_count;
    }

    public int getDownload() {
        return download;
    }

    public void setDownload(int download) {
        this.download = download;
    }

    public int getRecord() {
        return record;
    }

    public void setRecord(int record) {
        this.record = record;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getType() {
        return this.type;
    }

    public void setPackage_id(String package_id) {
        this.package_id = package_id;
    }

    public String getPackage_id() {
        return this.package_id;
    }

    public void setPackage_type(int package_type) {
        this.package_type = package_type;
    }

    public int getPackage_type() {
        return this.package_type;
    }

    public void setDownload_count_increment(int download_count_increment) {
        this.download_count_increment = download_count_increment;
    }

    public int getDownload_count_increment() {
        return this.download_count_increment;
    }

    public void setIs_recommend(int is_recommend) {
        this.is_recommend = is_recommend;
    }

    public int getIs_recommend() {
        return this.is_recommend;
    }

    public List<GameListTag> getTags() {
        return tags;
    }

    public void setTags(List<GameListTag> tags) {
        this.tags = tags;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public int getSort() {
        return this.sort;
    }

    public void setIsPlay(int IsPlay) {
        this.IsPlay = IsPlay;
    }

    public int getIsPlay() {
        return this.IsPlay;
    }

    public void setIsHot(int IsHot) {
        this.IsHot = IsHot;
    }

    public int getIsHot() {
        return this.IsHot;
    }

    public void setComment_num(int comment_num) {
        this.comment_num = comment_num;
    }

    public int getComment_num() {
        return comment_num;
    }

    public String getExt_detail() {
        return ext_detail;
    }

    public void setExt_detail(String ext_detail) {
        this.ext_detail = ext_detail;
    }

    public String getMain_publicize() {
        return main_publicize;
    }

    public void setMain_publicize(String main_publicize) {
        this.main_publicize = main_publicize;
    }

    @Override
    public String getPackage_names() {
        return package_name;
    }

    @Override
    public int getTask_type() {
        return 0;
    }

    @Override
    public String getDownload_link() {
        return download_url;
    }

    @Override
    public String getTask_name() {
        return name;
    }

    @Override
    public int getAcceptedTaskId() {
        return Id;
    }


    /**
     * 是否可以下载
     *
     * @return
     */
    public boolean isCanDownload() {
        return download == 1;//可以下载
    }

    /**
     * 是否可以记录
     *
     * @return
     */
    public boolean isCanRecord() {
        return record == 1;//1:可记录 其他：不可记录
    }

    private FindAppHelper findAppHelper = new FindAppHelper();

    public FindAppHelper getFindAppHelper() {
        return findAppHelper;
    }

    /**
     * 更新下载状态
     *
     * @param status
     */
    public void updateState(int status) {
        findAppHelper.updateState(status);
    }


    public DownloadHelper getDownloadHelper() {
        return findAppHelper.getDownloadHelper();
    }


    public void updateStateRelease(int status) {
        findAppHelper.getDownloadHelper().updateState(status);
    }

}
