Documentation ¶
Index ¶
- Constants
- Variables
- func InitStatsWorkers()
- func NewLootBoxCollection(dirPath string) (map[string]*LootBox, error)
- func StopStatsWorkers()
- type DrawResult
- type Item
- type ItemCategory
- type ItemShort
- type ItemShortQuantity
- type ItemShortQuantityFloat
- type LootBox
- func (lb *LootBox) AddCollectable(collectable string)
- func (lb *LootBox) Draw(isPity bool) (drawResult []DrawResult, err error)
- func (lb *LootBox) GetRemainingCollectables() []string
- func (lb *LootBox) Init()
- func (lb *LootBox) IsCollectable(target string) bool
- func (lb *LootBox) ListCollectables() (ret []*ItemShort)
- func (lb *LootBox) NewWhalingSession(collectables []string) (*WhalingSession, error)
- func (lb *LootBox) NewWhalingStatsSession(collectables []string) *WhalingStatsSession
- func (lb *LootBox) RefreshDrawTree() error
- func (lb *LootBox) RemoveOwnedCollectablesFromDropableItems()
- func (lb *LootBox) Transfer(index int, cat *ItemCategory, substitute *Item)
- type WhalingInput
- type WhalingSession
- type WhalingStatsSession
Constants ¶
View Source
const ( QuantityWhaling = "simple_whaling_quantity" TargetWhaling = "simple_whaling_target" )
View Source
const ( QuatityWhalingStats = "stats_whaling_quantity" TargetWhalingStats = "stats_whaling_target" )
View Source
const ( Target sessionType = iota Quantity Stop )
View Source
const ( StatsSessionCount = 1000 StatsWorkerCount = 8 )
View Source
const (
SafetyTargetWhaling = 100000
)
Variables ¶
View Source
var (
StateWorkerChan = make(chan *WhalingInput, StatsWorkerCount)
)
Functions ¶
func InitStatsWorkers ¶
func InitStatsWorkers()
func StopStatsWorkers ¶
func StopStatsWorkers()
Types ¶
type DrawResult ¶
type DrawResult struct { Item *Item Category *ItemCategory }
type Item ¶
type Item struct { Quantity uint64 `json:"quantity"` // Quantity dropped Name string `json:"name"` // Name of the item ID string `json:"id"` // Iternal ID Compensation *Item `json:"compensation"` // Compensation in case the player already have the item Attributes map[string]string `json:"attributes"` // map of attributes (ex: {"tier": "X"}) }
type ItemCategory ¶
type ItemCategory struct { Name string `json:"name"` // Name of the drop category ID string `json:"id"` // Iternal ID DropRate float64 `json:"drop_rate"` // Drop Rate (percentage) Collectable bool `json:"collectable"` // If true, If the player already have one of the items, it will be removed from the list of items which can drop Pitiable bool `json:"pitiable"` // If true, this item is part of the pity mechanic DropRateTransfersTo []string `json:"drop_rate_transfers_to"` // List of Categories the drop rate transfers to if player already has all items Items []*Item `json:"items"` // List of items to get }
type ItemShortQuantity ¶
type ItemShortQuantityFloat ¶
type LootBox ¶
type LootBox struct { Name string `json:"name"` Img string `json:"img"` Weight int `json:"weight"` ID string `json:"id"` Drops []map[string]*ItemCategory `json:"drops"` Pity uint64 `json:"pity"` Price float64 `json:"price"` ExchangeRateEuro float64 `json:"exchange_rate_euro"` ExchangeRateDollar float64 `json:"exchange_rate_dollar"` // contains filtered or unexported fields }
func NewLootBoxFromCSVs ¶
func NewLootBoxFromJson ¶
func (*LootBox) AddCollectable ¶
func (*LootBox) GetRemainingCollectables ¶
func (*LootBox) IsCollectable ¶
func (*LootBox) ListCollectables ¶
func (*LootBox) NewWhalingSession ¶
func (lb *LootBox) NewWhalingSession(collectables []string) (*WhalingSession, error)
func (*LootBox) NewWhalingStatsSession ¶
func (lb *LootBox) NewWhalingStatsSession(collectables []string) *WhalingStatsSession
func (*LootBox) RefreshDrawTree ¶
func (*LootBox) RemoveOwnedCollectablesFromDropableItems ¶
func (lb *LootBox) RemoveOwnedCollectablesFromDropableItems()
type WhalingInput ¶
type WhalingInput struct { SessionType sessionType Target string Quantity int WhalingSession *WhalingStatsSession OutChannel chan *WhalingSession }
type WhalingSession ¶
type WhalingSession struct { SimulationType string `json:"simulation_type"` Target string `json:"target"` ContainerOpened uint64 `json:"container_opened"` Pities uint64 `json:"pities"` Spent float64 `json:"game_money_spent"` SpentEuro float64 `json:"euro_spent"` SpentDollar float64 `json:"dollar_spent"` CollectableItems []*ItemShort `json:"collectables_items"` OtherItems []*ItemShortQuantity `json:"other_items"` ByAttribute map[string]map[string]uint64 `json:"by_attributes"` // contains filtered or unexported fields }
func (*WhalingSession) Draw ¶
func (ws *WhalingSession) Draw() (*ItemShort, error)
func (*WhalingSession) Finalize ¶
func (ws *WhalingSession) Finalize()
func (*WhalingSession) RemainingCollectables ¶
func (ws *WhalingSession) RemainingCollectables() []string
func (*WhalingSession) SimpleWhaling ¶
func (ws *WhalingSession) SimpleWhaling(counter int) error
func (*WhalingSession) TargetWhaling ¶
func (ws *WhalingSession) TargetWhaling(target string) error
type WhalingStatsSession ¶
type WhalingStatsSession struct { SimulationType string `json:"simulation_type"` Target string `json:"target"` Opened uint64 `json:"total_opened"` SessionCounter uint64 `json:"session_count"` OpenedEach []uint64 `json:"opened_each"` ByAttributeEach []map[string]map[string]uint64 `json:"by_attribute_each"` AverageByItem map[string]*ItemShortQuantityFloat `json:"avg_by_item"` AverageByAttribute map[string]map[string]float64 `json:"avg_by_attribute"` ContainterOpened uint64 `json:"session_opened"` AverageOpened float64 `json:"avg_opened"` AverageSpent float64 `json:"avg_game_money_spent"` AverageSpentDollar float64 `json:"avg_euro_spent"` AverageSpentEuro float64 `json:"avg_dollar_spent"` AveragePities float64 `json:"avg_pities"` AverageCollectablesItems float64 `json:"avg_collectable_items"` Percentiles map[string]uint64 `json:"percentiles_open"` // contains filtered or unexported fields }
func (*WhalingStatsSession) StatsSimpleWhaling ¶
func (wss *WhalingStatsSession) StatsSimpleWhaling(count int) error
func (*WhalingStatsSession) StatsTargetWhaling ¶
func (wss *WhalingStatsSession) StatsTargetWhaling(target string) error
Click to show internal directories.
Click to hide internal directories.