troopMath

package
v0.0.0-...-a62c5ed Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStructPointer

func GetStructPointer(PE *PlayersEntity, ET *EntryTexts)

Get WinnerCalc.go struct

Types

type DecreaseEntries

type DecreaseEntries struct {
	DecBefAtk  *widget.Entry
	DecBefDef  *widget.Entry
	DecBefHea  *widget.Entry
	DecAftAtk  *widget.Entry
	DecAftkDef *widget.Entry
	DecAftHea  *widget.Entry
}

func DecreaseCalc

func DecreaseCalc() *DecreaseEntries

type EntryTexts

type EntryTexts struct {
	// contains filtered or unexported fields
}

GUI Objects with integer value

type PlayerSatLosses

type PlayerSatLosses struct {
	PercentSat         float32 // Advantaged player's saturation
	Saturation         float32 // MinusLossSat support
	SaturationC        float32
	MinusLossSat       float32 // % of Advantage given by saturation
	AdvantagePlayerSat string
	LossesFWinner      string
	LossesFLoser       string
	LoserFWinner       string  // Unadvantaged player in saturation mechanic
	AdvantageTTroops   uint32  // Implements saturation mechanic in loser's hypothetical n. troops
	UnadvantageTTroops uint32  // Renew the troops weaker
	AdvantagedPlayer   string  // The Advantaged Player
	UnadvantagedPlayer string  // The Unadvantaged Player
	EightyCTTrAttacker float64 // 80% Theoretical Troops of Advantaged Player statistically
	EightyCTTrDefender float64
}

Saturation & Losses values

func LossesCalc

func LossesCalc(aE *widget.Entry, dE *widget.Entry, hE *widget.Entry, tE *widget.Entry, aDE *widget.Entry, dDE *widget.Entry, hDE *widget.Entry, tDE *widget.Entry) *PlayerSatLosses

Calculates the losses of the battle

type PlayersEntity

type PlayersEntity struct {
	PowerAttacker     uint32 // Hypothetical power of the attacker's troops
	PowerDefender     uint32 // Hypothetical power of the defender's troops
	PowerWeaker       uint32
	PowerStronger     uint32
	TroopsStronger    uint32
	TroopsWeaker      uint32
	EqualTroopNeeded  uint64 // Number of troops needed by the weaker player to equate the stronger opponent
	PowerTrAttacker   uint64
	PowerTrDefender   uint64
	PowerTrStronger   uint64
	PowerTrWeaker     uint64
	StrongerString    string
	WeakerString      string
	EightyCTrAttacker uint32 // Max losses of the attacker
	EightyCTrDefender uint32 // Max losses of the defender
	LossesAttacker    float64
	LossesDefender    float64
	Winner            string
	RWinner           string // The Real Winner counting Saturation
}

All the values needed to calculate the verdict of the battle

func WinnerCalc

func WinnerCalc(aE *widget.Entry, dE *widget.Entry, hE *widget.Entry, tE *widget.Entry, aDE *widget.Entry, dDE *widget.Entry, hDE *widget.Entry, tDE *widget.Entry) *PlayersEntity

Calculate the winner in an attack, returns a PlayersEntity struct which contains the necessary values

Jump to

Keyboard shortcuts

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