package com.sheep.gamegroup.model.entity;

import android.text.TextUtils;

import java.io.Serializable;

import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_GAME_SHEEP;
import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_GAME_TECENT;
import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_GAME_XIAO_MI;

/**
 * 游戏账户
 * Created by ljy on 2018/7/10.
 */

public class GameAccountEntity implements Serializable {

    private int task_id;//游戏id
    private String task_name;//游戏名称
    private int task_type;//游戏平台1002平台游戏，1003 腾讯游戏，1004 小米游戏

    private String account;
    private int game_type;
    private int id;
    private int tencent_platform;//腾讯平台账号类型 1:QQ 2:微信
    private int platform_receive;//是否平台领取 1是 2不是
    private String password;

    private int app_id;//应用id(小米)

    public int getApp_id() {
        return app_id;
    }

    public void setApp_id(int app_id) {
        this.app_id = app_id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public int getGame_type() {
        return game_type;
    }

    public void setGame_type(int game_type) {
        this.game_type = game_type;
    }

    public int getId() {
        return id;
    }

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

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getTask_id() {
        return task_id;
    }

    public void setTask_id(int task_id) {
        this.task_id = task_id;
    }

    public String getTask_name() {
        return task_name;
    }

    public void setTask_name(String task_name) {
        this.task_name = task_name;
    }

    public int getTask_type() {
        return task_type;
    }

    public void setTask_type(int task_type) {
        this.task_type = task_type;
    }

    public int getTencent_platform() {
        return tencent_platform;
    }

    public void setTencent_platform(int tencent_platform) {
        this.tencent_platform = tencent_platform;
    }

    public int getPlatform_receive() {
        return platform_receive;
    }

    public void setPlatform_receive(int platform_receive) {
        this.platform_receive = platform_receive;
    }











    public String getTypeName(){
        if(app_id > 0){
            return TextUtils.isEmpty(task_name)?"通用":task_name;
        }
        switch (task_id){
            case 0:
                return "通用";
            default:
                return TextUtils.isEmpty(task_name)?"通用":task_name;
        }
    }

    /**
     * 游戏详情，title显示
     */
    public String getDetailShow(){
        switch (task_type){
            case TASK_TYPE_GAME_SHEEP:
            default:
                return "平台游戏" + "--" + getTypeName();
            case TASK_TYPE_GAME_TECENT:
                return "腾讯游戏" + "--" + getTypeName();
            case TASK_TYPE_GAME_XIAO_MI:
                return "小米游戏" + "--" + getTypeName();
        }
    }
    public String getDetailShowForGameType(){
        switch (game_type){
            case TASK_TYPE_GAME_SHEEP:
            default:
                return "平台游戏" + "--" + getTypeName();
            case TASK_TYPE_GAME_TECENT:
                return "腾讯游戏" + "--" + getTypeName();
            case TASK_TYPE_GAME_XIAO_MI:
                return "小米游戏" + "--" + getTypeName();
        }
    }
    public String getDetailShowName(){
        switch (task_type){
            case TASK_TYPE_GAME_SHEEP:
            default:
                return "平台游戏";
            case TASK_TYPE_GAME_TECENT:
                return "腾讯游戏";
            case TASK_TYPE_GAME_XIAO_MI:
                return "小米游戏";
        }
    }

    /**
     * 是否是小米账号(这里不能通过task_type来判断)
     * @return
     */
    public boolean isXiaoMiAccount(){
        return app_id != 0;
    }
    /**
     * 是否是平台账号
     * @return
     */
    public boolean isPlatformAccount(){
        return platform_receive == 1;
    }
    /**
     * 平台账号不能删除
     * @return
     */
    public boolean cantDeleteAccount(){
        return isPlatformAccount();
    }
}
