package forms

type PlayerPassRoom struct {
	ID         uint `json:"id"`
	Count      int  `json:"count"`
	Difficulty int  `json:"difficulty"`
	Pass       bool `json:"pass"`
	IsActivity bool `json:"isActivity"`
	YearDay    int  `json:"yd"`
	EnterCount int  `json:"ec"`
}

type DropTalent struct {
	ID    uint `json:"id"`
	Count int  `json:"level"`
}

type DropedRoles struct {
	ID   int64 `json:"id"`
	Wear bool  `json:"wear"`
}

// DropEquipment 装备
type DropEquipment struct {
	GID  string `json:"id"`
	EID  int64  `json:"equipId"`
	Wear bool   `json:"wear"`
}

// PlayerTalent 天赋
type PlayerTalent struct {
	ID    int `json:"id"`
	Level int `json:"level"`
}

// DropMaterial 掉落物品
type DropMaterial struct {
	ID    int64 `json:"id"`
	Count int   `json:"count"`
}

// ExpireMaterial 购买商品，如会员 是否有会员根据里面是否有数据判断
type ExpireMaterial struct {
	ID         int64 `json:"id"`
	StartTime  int64 `json:"startTime"`
	EndTime    int64 `json:"endTime"`
	LastReward int64 `json:"lastReward"`
}

type PlayerMaterialModel struct {
	ID            int64                     `json:"id"`
	Playerid      int64                     `json:"playerid"`
	Coin          int64                     `json:"coin"`
	Diamond       int32                     `json:"diamond"`
	Equipments    map[string]*DropEquipment `json:"equipments"`
	Materials     map[int64]*DropMaterial   `json:"materials"`
	Roles         []*DropedRoles            `json:"roles"`
	Talents       map[int]int               `json:"talents"`
	PassRoom      []*PlayerPassRoom         `json:"passRoom"`
	RoleRes       map[int]int               `json:"roleRes"`
	BuffMaterials []*ExpireMaterial         `json:"buffMaterials"`
	AdLimit       string                    `json:"adLimit"`
}

type PlayerEquipmentsReq struct {
	ListReq
	PlayerId int64 `json:"playerid" form:"playerid" binding:"required"`
}
type PlayerEquipmentsRes struct {
	ListRes
}

type DropEquipmentList []DropEquipment

func (de DropEquipmentList) Len() int {
	return len(de)
}
func (de DropEquipmentList) Less(i, j int) bool {
	return de[i].EID < de[j].EID
}
func (de DropEquipmentList) Swap(i, j int) {
	de[i], de[j] = de[j], de[i]
}
