package msg

import (
	"leafstalk/covenant/model"
)

// Patrol 巡逻数据
type Patrol struct {
	PlayerId int64 `json:"userId"`
}

type PointsSettingData struct {
	model.ForagePointsSetting
	BaseValues map[int64]float64 `json:"baseValues"` // 基础值
	AddValues  map[int64]int64   `json:"addValues"`  // 加成值
}

type PatrolData struct {
	PointsSetting *PointsSettingData          `json:"pointsSetting"`
	TimeLen       int64                       `json:"timeLen"` //巡逻时长
	MaxTimeLen    int64                       `json:"maxTimeLen"`
	RewardData    map[int64]*model.DropedItem `json:"rewardData"` // 产出奖励
	AdNum         int64                       `json:"adNum"`
	FastNum       int64                       `json:"fastNum"`
}

type ResponsePatrol struct {
	ErrCode int         `json:"errCode"`
	Msg     string      `json:"msg,omitempty"`
	Data    *PatrolData `json:"data"`
}

// 巡逻时长
type PatrolTimeLen struct {
	PlayerId int64 `json:"userId"`
}

type ResponsePatrolTimeLen struct {
	ErrCode int                `json:"errCode"`
	Msg     string             `json:"msg,omitempty"`
	Data    *PatrolTimeLenData `json:"data"`
}

type PatrolTimeLenData struct {
	TimeLen    int64 `json:"timeLen"` //巡逻时长
	MaxTimeLen int64 `json:"maxTimeLen"`
}

// ReceiveReward 领取巡逻奖励
type ReceiveReward struct {
	PlayerId int64 `json:"userId"`
}

type ReceiveRewardData struct {
	TimeLen int64               `json:"timeLen"` //巡逻时长
	Bundles *model.DropedBundle `json:"bundles"`
}

type ResponseReceiveReward struct {
	ErrCode int                `json:"errCode"`
	Msg     string             `json:"msg,omitempty"`
	Data    *ReceiveRewardData `json:"data"`
}

// PointsSetting 加成点数分配
type PointsSetting struct {
	PlayerId      int64           `json:"userId"`
	PointsSetting map[int64]int64 `json:"pointsSetting"`
}

type ResponsePointsSetting struct {
	ErrCode int                `json:"errCode"`
	Msg     string             `json:"msg,omitempty"`
	Data    *PointsSettingData `json:"data"`
}

// FastPatrol 快速巡逻
type FastPatrol struct {
	PlayerId int64 `json:"userId"`
	Type     int64 `json:"type"` // 1:ad 2:fast
}

type FastPatrolData struct {
	AdNum   int64               `json:"adNum"`
	FastNum int64               `json:"fastNum"`
	TimeLen int64               `json:"timeLen"` //巡逻时长
	Bundles *model.DropedBundle `json:"bundles"`
	Cost    map[int64]int64     `json:"cost"` // 消耗
}

type ResponseFastPatrol struct {
	ErrCode int             `json:"errCode"`
	Msg     string          `json:"msg,omitempty"`
	Data    *FastPatrolData `json:"data"`
}

/* rpc调用参数 */

type PatrolReceiveReward struct {
	PlayerId int64                       `json:"userId"`
	Reward   map[int64]*model.DropedItem `json:"reward"`
	Cost     map[int64]int64             `json:"cost"`
}

type InitPatrol struct {
	PlayerId int64 `json:"userId"`
	Level    int64 `json:"level"`
	Point    int64 `json:"point"`
}

// 购买特权卡后续处理
type BuyPrivilegeCardToPatrol struct {
	PlayerId int64           `json:"userId"`
	Cards    map[int64]int64 `json:"cards"`
}

type BuyMonthCardToPatrol struct {
	PlayerId int64                          `json:"userId"`
	Cards    map[int64]*model.MonthCardItem `json:"cards"`
}
