Documentation
¶
Index ¶
- func AddPoints(db *database.Db, userId bson.ObjectId, points int64) error
- func ConstructionTime(r Resources, roboticsLvl int64) int64
- func CrystalGrowth(ilvl int64, idelta int64) int64
- func CrystalMineEnergyConsumption(ilvl int64) int64
- func DeuteriumGrowth(ilvl int64, idelta int64) int64
- func DeuteriumMineEnergyConsumption(ilvl int64) int64
- func FusionGrowth(ilvl int64, ilvlTech int64, idelta int64) int64
- func MetalGrowth(ilvl int64, idelta int64) int64
- func MetalMineEnergyConsumption(ilvl int64) int64
- func ResourcesToPoints(r Resources) int64
- func RessearchTime(r Resources, researchLvl int64) int64
- func SolarGrowth(ilvl int64) int64
- type Planet
- func (p *Planet) CheckCurrentBuild() (bool, error)
- func (p *Planet) GetBuildingCost(building string) (Resources, error)
- func (p *Planet) GetFromDb() error
- func (p *Planet) GetResources() (*Resources, error)
- func (p *Planet) SpendResources(r Resources) error
- func (p *Planet) StoreInDb() error
- func (p *Planet) UpgradeBuilding(building string) error
- type Process
- type Resources
- func AllianceDepotCost(ilvl int64) Resources
- func CrystalMineCost(ilvl int64) Resources
- func CrystalStorageCost(ilvl int64) Resources
- func DeuteriumMineCost(ilvl int64) Resources
- func DeuteriumStorageCost(ilvl int64) Resources
- func EnergyMineCost(ilvl int64) Resources
- func FussionReactorCost(ilvl int64) Resources
- func MetalMineCost(ilvl int64) Resources
- func MetalStorageCost(ilvl int64) Resources
- func MissileSiloCost(ilvl int64) Resources
- func RessearchLabCost(ilvl int64) Resources
- func RoboticsFactoryCost(ilvl int64) Resources
- func ShipyardCost(ilvl int64) Resources
- func SpaceDockCost(ilvl int64) Resources
- type SolarSystem
- type User
- type UserDb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructionTime ¶
TODO ConstructionTime and ResearchTime are following the formulas from https://ogame.fandom.com/wiki/Formulas but are not giving exact same numbers than in online calculators
func CrystalGrowth ¶
func DeuteriumGrowth ¶
func ResourcesToPoints ¶
func RessearchTime ¶
func SolarGrowth ¶
Types ¶
type Planet ¶
type Planet struct { Db *database.Db Id bson.ObjectId `json:"id" bson:"_id,omitempty"` LastUpdated time.Time Size int64 // fields/slots Name string OwnerId bson.ObjectId Resources Resources Buildings map[string]int64 CurrentBuild Process Research Process }
func (*Planet) CheckCurrentBuild ¶
CheckCurrentBuild checks if the planet has a ongoing building in process, and if has finished in case that has finished, updates it in db
func (*Planet) GetBuildingCost ¶
func (*Planet) GetResources ¶
GetResources updates the values of resources and returns the value, also updates the user.Resources Resource types: metal, crystal, deuterium, energy
func (*Planet) SpendResources ¶
SpendResources checks if user has enough resources, then substracts the resources, and updates the amounts in the database
func (*Planet) UpgradeBuilding ¶
type Resources ¶
func AllianceDepotCost ¶
func CrystalMineCost ¶
func CrystalStorageCost ¶
func DeuteriumMineCost ¶
func DeuteriumStorageCost ¶
func EnergyMineCost ¶
func FussionReactorCost ¶
func MetalMineCost ¶
func MetalStorageCost ¶
func MissileSiloCost ¶
func RessearchLabCost ¶
func RoboticsFactoryCost ¶
func ShipyardCost ¶
func SpaceDockCost ¶
type SolarSystem ¶
Click to show internal directories.
Click to hide internal directories.