Format imports with goimport
This commit is contained in:
@@ -4,8 +4,9 @@
|
||||
package dbmapping
|
||||
|
||||
import (
|
||||
"github.com/go-sql-driver/mysql"
|
||||
"time"
|
||||
|
||||
"github.com/go-sql-driver/mysql"
|
||||
)
|
||||
|
||||
// Order is a struct, which represents `orders` table item in databse.
|
||||
|
@@ -4,8 +4,9 @@
|
||||
package dbmapping
|
||||
|
||||
import (
|
||||
"source.wtfteam.pro/i2_bot/i2_bot/lib/datamapping"
|
||||
"time"
|
||||
|
||||
"source.wtfteam.pro/i2_bot/i2_bot/lib/datamapping"
|
||||
)
|
||||
|
||||
// Player is a struct, which represents `players` table item in databse.
|
||||
|
@@ -1,16 +0,0 @@
|
||||
// i2_bot – Instinct PokememBro Bot
|
||||
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
|
||||
|
||||
package dbmapping
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// PokememeElement is a struct, which represents `pokememes_elements` table item in databse.
|
||||
type PokememeElement struct {
|
||||
ID int `db:"id"`
|
||||
PokememeID int `db:"pokememe_id"`
|
||||
ElementID int `db:"element_id"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
// i2_bot – Instinct PokememBro Bot
|
||||
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
|
||||
|
||||
package dbmapping
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// PokememeLocation is a struct, which represents `pokememes_locations` table item in databse.
|
||||
type PokememeLocation struct {
|
||||
ID int `db:"id"`
|
||||
PokememeID int `db:"pokememe_id"`
|
||||
LocationID int `db:"location_id"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
}
|
@@ -4,7 +4,6 @@
|
||||
package dbmapping
|
||||
|
||||
import (
|
||||
"math"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -22,18 +21,12 @@ type Profile struct {
|
||||
EggExp int `db:"egg_exp"`
|
||||
Power int `db:"power"`
|
||||
WeaponID int `db:"weapon_id"`
|
||||
Crystalls int `db:"crystalls"`
|
||||
Crystals int `db:"crystalls"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
}
|
||||
|
||||
// FullExp returns exp points in summary, gained after registration
|
||||
func (p *Profile) FullExp() int {
|
||||
fullExp := 0.00
|
||||
|
||||
for i := 1; i < p.LevelID+1; i++ {
|
||||
fullExp = fullExp + (100 * math.Pow(2.0, float64(i)))
|
||||
}
|
||||
|
||||
fullExp += float64(p.Exp)
|
||||
return int(fullExp)
|
||||
// ProfileWithPokememes is a struct, which represents full profile with current hand
|
||||
type ProfileWithPokememes struct {
|
||||
Profile Profile
|
||||
Pokememes ProfilePokememe
|
||||
}
|
||||
|
Reference in New Issue
Block a user