solo

package
v0.0.0-...-6f0d0d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseSoloContract

type BaseSoloContract interface {
	GetPlayerId() string
	GetPlayerNickname() string
	GetId() string
	GetName() string
	GetIsElite() bool
	GetEggType() api.EggType
	GetUltimateGoal() float64
	GetRewards() []*api.Reward
	GetEggsLaid() float64
	GetEggsPerSecond() float64
	GetDurationUntilProductionDeadline() time.Duration
	GetDurationUntilCollectionDeadline() time.Duration
	GetServerRefreshTime() time.Time
}

type Player

type Player struct {
	Id       string
	Nickname string
	Progress *api.FirstContact_Payload_Progress
}

func GetPlayer

func GetPlayer(backup *api.FirstContact_Payload) *Player

func (*Player) EarningBonus

func (p *Player) EarningBonus() float64

func (*Player) EarningBonusPercentage

func (p *Player) EarningBonusPercentage() float64

type SoloContract

type SoloContract struct {
	BaseSoloContract
}

func GetActiveSoloContracts

func GetActiveSoloContracts(backup *api.FirstContact_Payload) []*SoloContract

func UnmarshalSoloContract

func UnmarshalSoloContract(b []byte) (*SoloContract, error)

func (*SoloContract) Display

func (c *SoloContract) Display(now time.Time, multiAccountMode bool)

func (*SoloContract) ExpectedDurationUntilFinish

func (c *SoloContract) ExpectedDurationUntilFinish() time.Duration

func (*SoloContract) GetEggsPerHour

func (c *SoloContract) GetEggsPerHour() float64

func (*SoloContract) GetOfflineAdjustedEggsLaid

func (c *SoloContract) GetOfflineAdjustedEggsLaid(clientRefreshTime time.Time) float64

GetOfflineAdjustedEggsLaid returns server-reported EggsLaid plus expected amount laid during offline time (duration between last server refresh and specified client refresh), which is capped at 30hr.

func (*SoloContract) GetOfflineAdjustedExpectedDurationUntilFinish

func (c *SoloContract) GetOfflineAdjustedExpectedDurationUntilFinish(clientRefreshTime time.Time) time.Duration

GetOfflineAdjustedExpectedDurationUntilFinish returns expected duration until finish minus the offline duration (duration between last server refresh and specified client refresh), capped at 30hr.

func (*SoloContract) HasCompleted

func (c *SoloContract) HasCompleted() bool

func (*SoloContract) HasNoTimeLeft

func (c *SoloContract) HasNoTimeLeft() bool

func (*SoloContract) IsOnTrackToFinish

func (c *SoloContract) IsOnTrackToFinish() bool

func (*SoloContract) Marshal

func (c *SoloContract) Marshal() ([]byte, error)

func (*SoloContract) ProgressInfo

func (c *SoloContract) ProgressInfo() *contract.ProgressInfo

func (*SoloContract) ProgressInfoWithProjection

func (c *SoloContract) ProgressInfoWithProjection(projectedEggsLaid float64) *contract.ProgressInfo

func (*SoloContract) RequiredEggsPerHour

func (c *SoloContract) RequiredEggsPerHour() float64

func (*SoloContract) ToPBSoloContract

func (c *SoloContract) ToPBSoloContract() *pb.SoloContract

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL