package com.gh.gamecenter.entity;

import android.support.v4.util.ArrayMap;

import com.gh.download.DownloadEntity;
import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;

public class GameEntity {

	@SerializedName("_id")
	private String id;

	private String icon;

	private String name;

	private String brief;

	private ArrayList<String> tag;

	private ArrayList<ApkEntity> apk;

	private ArrayList<GameCollectionEntity> collection;

	private String slide;

	private TestEntity test;

	@SerializedName("d_button_add_word")
	private String downloadAddWord;

	private ArrayMap<String, DownloadEntity> entryMap;

	private String image;

	private String type;

	private boolean isPluggable;

	private String link;

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public String getId() {
		return id;
	}

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

	public String getIcon() {
		return icon;
	}

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

	public String getName() {
		return name;
	}

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

	public String getBrief() {
		return brief;
	}

	public void setBrief(String brief) {
		this.brief = brief;
	}

	public ArrayList<String> getTag() {
		return tag;
	}

	public void setTag(ArrayList<String> tag) {
		this.tag = tag;
	}

	public ArrayList<ApkEntity> getApk() {
		if (apk == null) {
			apk = new ArrayList<>();
		}
		return apk;
	}

	public void setApk(ArrayList<ApkEntity> apk) {
		this.apk = apk;
	}

	public ArrayList<GameCollectionEntity> getCollection() {
		return collection;
	}

	public void setCollection(ArrayList<GameCollectionEntity> collection) {
		this.collection = collection;
	}

	public String getSlide() {
		return slide;
	}

	public void setSlide(String slide) {
		this.slide = slide;
	}

	public TestEntity getTest() {
		return test;
	}

	public void setTest(TestEntity test) {
		this.test = test;
	}

	public ArrayMap<String, DownloadEntity> getEntryMap() {
		return entryMap;
	}

	public void setEntryMap(ArrayMap<String, DownloadEntity> entryMap) {
		this.entryMap = entryMap;
	}

	public String getDownloadAddWord() {
		return downloadAddWord;
	}

	public void setDownloadAddWord(String downloadAddWord) {
		this.downloadAddWord = downloadAddWord;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getType() {
		return type;
	}

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

	public boolean isPluggable() {
		return isPluggable;
	}

	public void setPluggable(boolean pluggable) {
		isPluggable = pluggable;
	}

	public GameEntity clone() {
		GameEntity gameEntity = new GameEntity();
		gameEntity.setId(id);
		gameEntity.setIcon(icon);
		gameEntity.setName(name);
		gameEntity.setBrief(brief);
		gameEntity.setTag(new ArrayList<>(tag));
		gameEntity.setApk(new ArrayList<>(apk));
		gameEntity.setSlide(slide);
		gameEntity.setTest(test);
		gameEntity.setDownloadAddWord(downloadAddWord);
		gameEntity.setEntryMap(new ArrayMap<String, DownloadEntity>(entryMap));
		gameEntity.setImage(image);
		gameEntity.setType(type);
		gameEntity.setPluggable(isPluggable);
		return gameEntity;
	}

	@Override
	public String toString() {
		return "GameEntity{" +
				"id='" + id + '\'' +
				", icon='" + icon + '\'' +
				", name='" + name + '\'' +
				", brief='" + brief + '\'' +
				", tag=" + tag +
				", apk=" + apk +
				", collection=" + collection +
				", slide='" + slide + '\'' +
				", test=" + test +
				", downloadAddWord='" + downloadAddWord + '\'' +
				", entryMap=" + entryMap +
				", image='" + image + '\'' +
				", type='" + type + '\'' +
				", isPluggable=" + isPluggable +
				", link='" + link + '\'' +
				'}';
	}
}
