Last active 1749413863

jspc's Avatar jspc revised this gist 1749413862. Go to revision

1 file changed, 39 insertions

player.go(file created)

@@ -0,0 +1,39 @@
1 + package players
2 +
3 + import "time"
4 +
5 + type Player struct {
6 + Name string
7 + DOB time.Time
8 + PositionalData PositionalData
9 +
10 + Goalkeeping Stat
11 + Tackling Stat
12 + ClosingDown Stat
13 + Clearances Stat
14 + LongBalls Stat
15 + Crossing Stat
16 + Heading Stat
17 + ShortPassing Stat
18 + Finishing Stat
19 + }
20 +
21 + func (p Player) Goalkeeper() float64 {
22 + return (p.Goalkeeping.Current + (p.Clearances.Current / 2)) * p.PositionalData.Gk
23 + }
24 +
25 + func (p Player) Defence(ps PositionalSide) float64 {
26 + return (p.Tackling.Current + p.ClosingDown.Current + p.Clearances.Current + (p.LongBalls.Current / 2)) * p.PositionalData.Defence * p.PositionalData.FootednesMultiplier(ps)
27 + }
28 +
29 + func (p Player) Central(ps PositionalSide) float64 {
30 + return ((p.Tackling.Current / 2) + (p.ClosingDown.Current / 2) + p.Clearances.Current + p.LongBalls.Current + p.ShortPassing.Current) * p.PositionalData.Midfield * p.PositionalData.FootednesMultiplier(ps)
31 + }
32 +
33 + func (p Player) Winger(ps PositionalSide) float64 {
34 + return (p.LongBalls.Current + p.ShortPassing.Current + (p.Crossing.Current * 2) + p.Finishing.Current) * p.PositionalData.Midfield * p.PositionalData.FootednesMultiplier(ps)
35 + }
36 +
37 + func (p Player) Forward(ps PositionalSide) float64 {
38 + return (p.Heading.Current + p.ShortPassing.Current + p.Finishing.Current) * p.PositionalData.Striker * p.PositionalData.FootednesMultiplier(ps)
39 + }
Newer Older