mirror of
https://github.com/arnaucube/gogame.git
synced 2026-02-06 19:16:40 +01:00
add CreatePlanet and put planet in solar system
This commit is contained in:
@@ -3,9 +3,10 @@ package database
|
||||
import mgo "gopkg.in/mgo.v2"
|
||||
|
||||
type Db struct {
|
||||
Users *mgo.Collection
|
||||
Planets *mgo.Collection
|
||||
Galaxies *mgo.Collection
|
||||
Users *mgo.Collection
|
||||
Planets *mgo.Collection
|
||||
SolarSystems *mgo.Collection
|
||||
Galaxies *mgo.Collection
|
||||
}
|
||||
|
||||
func New(url string, databaseName string) (*Db, error) {
|
||||
@@ -24,6 +25,7 @@ func New(url string, databaseName string) (*Db, error) {
|
||||
db := Db{}
|
||||
db.Users = session.DB(databaseName).C("users")
|
||||
db.Planets = session.DB(databaseName).C("planets")
|
||||
db.SolarSystems = session.DB(databaseName).C("solarsystems")
|
||||
db.Galaxies = session.DB(databaseName).C("galaxies")
|
||||
|
||||
return &db, nil
|
||||
|
||||
Reference in New Issue
Block a user