package com.sheep.gamegroup.model.entity;

import android.text.TextUtils;

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

import java.io.Serializable;

/**
 * 玩转游戏
 * Created by ljy on 2018/9/3.
 */

public class PlayGameEntity implements IDownload, Serializable {
    private int Id;//integer($int64)
    private int IsHot;//integer($int64)是否近期最热 1是 2不是

    private int IsPlay;//integer($int64)是否每日必玩 1是 2不是

    private int available_receive;//integer($int64)0:可领取账号 1:不可领取账号

    private long created_at;//integer($int64)
    private int download;//integer($int64)1:可下载 其他：不可下载

    private long download_at;//integer($int64)预约下载开放时间

    private long download_count;//integer($int64)下载数量

    private long download_count_increment;//integer($int64)下载数量的增量

    private int download_type;//integer($int32)1：非预约下载 2：预约下载

    private String download_url;//string下载地址

    private String icon;//string应用图标

    private String intro;//string应用简介

    private int is_recommend;//integer($int32)是否推荐：0：不推荐 1：推荐

    private String manufacturer;//string厂商

    private String name;//string应用名称

    private String package_id;//stringGameID

    private String package_name;//string应用包名称

    private String package_size;//number($float)包大小(M)

    private int package_type;//integer($int64)出包类型：1：快发出包 2：腾讯出包 3：小米出包 4：其它

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

    private int platform;//integer($int32)平台 0：全 1：安卓 2：IOS

    private int receive_account;//integer($int64)0:未领取账号 1:已领取账号

    private int record;//integer($int64)1:可记录 其他：不可记录

    private float score;//number($float)评分

    private long score_count;//integer($int64)评分人数

    private int sort;//integer($int64)排序：越大越靠前

    private int status;//integer($int32)1:开启 2：关闭

    private String type;//string类型

    private long updated_at;//integer($int64)
    private String versions;//string版本号

    private String game_tag;//游戏标签，可多选，逗号分割

    public String getGame_tag() {
        return game_tag;
    }

    public void setGame_tag(String game_tag) {
        this.game_tag = game_tag;
    }

    public int getId() {
        return Id;
    }

    public void setId(int id) {
        Id = id;
    }

    public int getIsHot() {
        return IsHot;
    }

    public void setIsHot(int isHot) {
        IsHot = isHot;
    }

    public int getIsPlay() {
        return IsPlay;
    }

    public void setIsPlay(int isPlay) {
        IsPlay = isPlay;
    }

    public int getAvailable_receive() {
        return available_receive;
    }

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

    public long getCreated_at() {
        return created_at;
    }

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

    public int getDownload() {
        return download;
    }

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

    public long getDownload_at() {
        return download_at;
    }

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

    public long getDownload_count() {
        return download_count;
    }

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

    public long getDownload_count_increment() {
        return download_count_increment;
    }

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

    public int getDownload_type() {
        return download_type;
    }

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

    public String getDownload_url() {
        return download_url;
    }

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


    @Override
    public boolean equals(Object obj) {
        return obj instanceof PlayGameEntity && Id == ((PlayGameEntity) obj).Id;
    }

    @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;
    }

    public String getIcon() {
        return icon;
    }

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

    public String getIntro() {
        return intro;
    }

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

    public int getIs_recommend() {
        return is_recommend;
    }

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

    public String getManufacturer() {
        return manufacturer;
    }

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

    public String getName() {
        return name;
    }

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

    public String getPackage_id() {
        return package_id;
    }

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

    public String getPackage_name() {
        return package_name;
    }

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

    public String getPackage_size() {
        return TextUtils.isEmpty(package_size)?"0":package_size;
    }

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

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

    public int getPackage_type() {
        return package_type;
    }

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

    public String getPictures() {
        return pictures;
    }

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

    public int getPlatform() {
        return platform;
    }

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

    public int getReceive_account() {
        return receive_account;
    }

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

    public int getRecord() {
        return record;
    }

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

    public float getScore() {
        return score;
    }

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

    public long getScore_count() {
        return score_count;
    }

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

    public int getSort() {
        return sort;
    }

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

    public int getStatus() {
        return status;
    }

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

    public String getType() {
        return type;
    }

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

    public long getUpdated_at() {
        return updated_at;
    }

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

    public String getVersions() {
        return versions;
    }

    public void setVersions(String versions) {
        this.versions = versions;
    }
    /**
     * 是否可以下载
     * @return
     */
    public boolean isCanDownload(){
        return download == 1;//可以下载
    }
    /**
     * 是否可以记录
     * @return
     */
    public boolean isCanRecord() {
        return record == 1;//1:可记录 其他：不可记录
    }
    private FindAppHelper findAppHelper = new FindAppHelper();
    private DownloadHelper downloadHelper = new DownloadHelper();

    public FindAppHelper getFindAppHelper() {
        return findAppHelper;
    }
    public DownloadHelper getDownloadHelper() {
        return downloadHelper;
    }

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