Documentation
¶
Index ¶
- type BaseSoloContract
- type Player
- type SoloContract
- func (c *SoloContract) Display(now time.Time, multiAccountMode bool)
- func (c *SoloContract) ExpectedDurationUntilFinish() time.Duration
- func (c *SoloContract) GetEggsPerHour() float64
- func (c *SoloContract) GetOfflineAdjustedEggsLaid(clientRefreshTime time.Time) float64
- func (c *SoloContract) GetOfflineAdjustedExpectedDurationUntilFinish(clientRefreshTime time.Time) time.Duration
- func (c *SoloContract) HasCompleted() bool
- func (c *SoloContract) HasNoTimeLeft() bool
- func (c *SoloContract) IsOnTrackToFinish() bool
- func (c *SoloContract) Marshal() ([]byte, error)
- func (c *SoloContract) ProgressInfo() *contract.ProgressInfo
- func (c *SoloContract) ProgressInfoWithProjection(projectedEggsLaid float64) *contract.ProgressInfo
- func (c *SoloContract) RequiredEggsPerHour() float64
- func (c *SoloContract) ToPBSoloContract() *pb.SoloContract
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 (*Player) EarningBonusPercentage ¶
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) 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
Click to show internal directories.
Click to hide internal directories.