Archived
1

Format imports with goimport

This commit is contained in:
2018-05-02 07:25:39 +04:00
parent ef9cf07abc
commit 86afa52a56
43 changed files with 108 additions and 128 deletions

View File

@@ -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.

View File

@@ -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.

View File

@@ -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"`
}

View File

@@ -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"`
}

View File

@@ -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
}