Archived
1

Pokememes possibilities, some refactoring

This commit is contained in:
Vladimir Hodakov
2017-10-13 03:05:26 +04:00
parent 2849d16587
commit ef924d26c7
29 changed files with 438 additions and 293 deletions

17
lib/dbmapping/elements.go Normal file
View File

@@ -0,0 +1,17 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type Element struct {
Id int `db:"id"`
Symbol string `db:"symbol"`
Name string `db:"name"`
League_id int `db:"league_id"`
Created_at *time.Time `db:"created_at"`
}

16
lib/dbmapping/leagues.go Normal file
View File

@@ -0,0 +1,16 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type League struct {
Id int `db:"id"`
Symbol string `db:"symbol"`
Name string `db:"name"`
Created_at *time.Time `db:"created_at"`
}

16
lib/dbmapping/levels.go Normal file
View File

@@ -0,0 +1,16 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type Level struct {
Id int `db:"id"`
Max_exp int `db:"max_exp"`
Max_egg int `db:"max_egg"`
Created_at time.Time `db:"created_at"`
}

View File

@@ -0,0 +1,16 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type Location struct {
Id int `db:"id"`
Symbol string `db:"symbol"`
Name string `db:"name"`
Created_at time.Time `db:"created_at"`
}

19
lib/dbmapping/players.go Normal file
View File

@@ -0,0 +1,19 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type Player struct {
Id int `db:"id"`
Telegram_id int `db:"telegram_id"`
League_id int `db:"league_id"`
Squad_id int `db:"squad_id"`
Status string `db:"status"`
Created_at time.Time `db:"created_at"`
Updated_at time.Time `db:"updated_at"`
}

View File

@@ -0,0 +1,33 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type Pokememe struct {
Id int `db:"id"`
Grade int `db:"grade"`
Name string `db:"name"`
Description string `db:"description"`
Attack int `db:"attack"`
HP int `db:"hp"`
MP int `db:"mp"`
Defence int `db:"defence"`
Price int `db:"price"`
Purchaseable bool `db:"purchaseable"`
Image_url string `db:"image_url"`
Player_id int `db:"player_id"`
Created_at time.Time `db:"created_at"`
}
// Type for handling pokememe with all informations about locations and elements
type PokememeFull struct {
Pokememe Pokememe
Locations []Location
Elements []Element
}

View File

@@ -0,0 +1,16 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type PokememeElement struct {
Id int `db:"id"`
Pokememe_id int `db:"pokememe_id"`
Element_id int `db:"element_id"`
Created_at time.Time `db:"created_at"`
}

View File

@@ -0,0 +1,16 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type PokememeLocation struct {
Id int `db:"id"`
Pokememe_id int `db:"pokememe_id"`
Location_id int `db:"location_id"`
Created_at time.Time `db:"created_at"`
}

25
lib/dbmapping/profiles.go Normal file
View File

@@ -0,0 +1,25 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type Profile struct {
Id int `db:"id"`
Player_id int `db:"player_id"`
Nickname string `db:"nickname"`
TelegramNickname string `db:"telegram_nickname"`
Level_id int `db:"level_id"`
Pokeballs int `db:"pokeballs"`
Wealth int `db:"wealth"`
Exp int `db:"exp"`
Egg_exp int `db:"egg_exp"`
Power int `db:"power"`
Weapon_id int `db:"weapon_id"`
Crystalls int `db:"crystalls"`
Created_at time.Time `db:"created_at"`
}

View File

@@ -0,0 +1,18 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type ProfilePokememe struct {
Id int `db:"id"`
Profile_id int `db:"profile_id"`
Pokememe_id int `db:"pokememe_id"`
Pokememe_lvl int `db:"pokememe_lvl"`
Pokememe_rarity string `db:"pokememe_rarity"`
Created_at time.Time `db:"created_at"`
}

17
lib/dbmapping/weapons.go Normal file
View File

@@ -0,0 +1,17 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
type Weapon struct {
Id int `db:"id"`
Name string `db:"name"`
Power int `db:"power"`
Price int `db:"price"`
Created_at time.Time `db:"created_at"`
}