refactor: func naming
This commit is contained in:
@@ -16,7 +16,7 @@ func (c Controller) RaceID(actor string) (uuid.UUID, error) {
|
||||
return c.Cache.g.Race[ri].ID, nil
|
||||
}
|
||||
|
||||
func (c Controller) QuitGame(actor string) error {
|
||||
func (c Controller) RaceQuit(actor string) error {
|
||||
ri, err := c.Cache.validRace(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -25,7 +25,7 @@ func (c Controller) QuitGame(actor string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c Controller) GiveVotes(actor, acceptor string) error {
|
||||
func (c Controller) RaceVote(actor, acceptor string) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -38,7 +38,7 @@ func (c Controller) GiveVotes(actor, acceptor string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c Controller) UpdateRelation(actor, acceptor string, v string) error {
|
||||
func (c Controller) RaceRelation(actor, acceptor string, v string) error {
|
||||
rel, ok := game.ParseRelation(v)
|
||||
if !ok {
|
||||
return e.NewUnknownRelationError(v)
|
||||
@@ -54,7 +54,7 @@ func (c Controller) UpdateRelation(actor, acceptor string, v string) error {
|
||||
return c.Cache.UpdateRelation(ri, other, rel)
|
||||
}
|
||||
|
||||
func (c *Controller) CreateShipType(actor, typeName string, drive float64, ammo int, weapons, shileds, cargo float64) error {
|
||||
func (c *Controller) ShipClassCreate(actor, typeName string, drive float64, ammo int, weapons, shileds, cargo float64) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -62,7 +62,7 @@ func (c *Controller) CreateShipType(actor, typeName string, drive float64, ammo
|
||||
return c.Cache.ShipClassCreate(ri, typeName, drive, ammo, weapons, shileds, cargo)
|
||||
}
|
||||
|
||||
func (c *Controller) MergeShipType(actor, name, targetName string) error {
|
||||
func (c *Controller) ShipClassMerge(actor, name, targetName string) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -70,7 +70,7 @@ func (c *Controller) MergeShipType(actor, name, targetName string) error {
|
||||
return c.Cache.shipClassMerge(ri, name, targetName)
|
||||
}
|
||||
|
||||
func (c *Controller) DeleteShipType(actor, typeName string) error {
|
||||
func (c *Controller) ShipClassRemove(actor, typeName string) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -78,7 +78,7 @@ func (c *Controller) DeleteShipType(actor, typeName string) error {
|
||||
return c.Cache.shipClassRemove(ri, typeName)
|
||||
}
|
||||
|
||||
func (c *Controller) LoadCargo(actor string, groupIndex uint, cargoType string, ships uint, quantity float64) error {
|
||||
func (c *Controller) ShipGroupLoad(actor string, groupIndex uint, cargoType string, ships uint, quantity float64) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -90,7 +90,7 @@ func (c *Controller) LoadCargo(actor string, groupIndex uint, cargoType string,
|
||||
return c.Cache.shipGroupLoad(ri, groupIndex, ct, ships, quantity)
|
||||
}
|
||||
|
||||
func (c *Controller) UnloadCargo(actor string, groupIndex uint, ships uint, quantity float64) error {
|
||||
func (c *Controller) ShipGroupUnload(actor string, groupIndex uint, ships uint, quantity float64) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -98,7 +98,7 @@ func (c *Controller) UnloadCargo(actor string, groupIndex uint, ships uint, quan
|
||||
return c.Cache.shipGroupUnload(ri, groupIndex, ships, quantity)
|
||||
}
|
||||
|
||||
func (c *Controller) SendGroup(actor string, groupIndex, planetNumber, quantity uint) error {
|
||||
func (c *Controller) ShipGroupSend(actor string, groupIndex, planetNumber, quantity uint) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -106,7 +106,7 @@ func (c *Controller) SendGroup(actor string, groupIndex, planetNumber, quantity
|
||||
return c.Cache.shipGroupSend(ri, groupIndex, planetNumber, quantity)
|
||||
}
|
||||
|
||||
func (c *Controller) UpgradeGroup(actor string, groupIndex uint, techInput string, limitShips uint, limitLevel float64) error {
|
||||
func (c *Controller) ShipGroupUpgrade(actor string, groupIndex uint, techInput string, limitShips uint, limitLevel float64) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -114,7 +114,7 @@ func (c *Controller) UpgradeGroup(actor string, groupIndex uint, techInput strin
|
||||
return c.Cache.shipGroupUpgrade(ri, groupIndex, techInput, limitShips, limitLevel)
|
||||
}
|
||||
|
||||
func (c *Controller) JoinEqualGroups(actor string) error {
|
||||
func (c *Controller) ShipGroupMerge(actor string) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -123,7 +123,7 @@ func (c *Controller) JoinEqualGroups(actor string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Controller) BreakGroup(actor string, groupIndex, quantity uint) error {
|
||||
func (c *Controller) ShipGroupBreak(actor string, groupIndex, quantity uint) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -131,7 +131,7 @@ func (c *Controller) BreakGroup(actor string, groupIndex, quantity uint) error {
|
||||
return c.Cache.ShipGroupBreak(ri, groupIndex, quantity)
|
||||
}
|
||||
|
||||
func (c *Controller) DisassembleGroup(actor string, groupIndex, quantity uint) error {
|
||||
func (c *Controller) ShipGroupDismantle(actor string, groupIndex, quantity uint) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -139,7 +139,7 @@ func (c *Controller) DisassembleGroup(actor string, groupIndex, quantity uint) e
|
||||
return c.Cache.shipGroupDismantle(ri, groupIndex, quantity)
|
||||
}
|
||||
|
||||
func (c *Controller) TransferGroup(actor, acceptor string, groupIndex, quantity uint) error {
|
||||
func (c *Controller) ShipGroupTransfer(actor, acceptor string, groupIndex, quantity uint) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -151,7 +151,7 @@ func (c *Controller) TransferGroup(actor, acceptor string, groupIndex, quantity
|
||||
return c.Cache.shipGroupTransfer(ri, riAccept, groupIndex, quantity)
|
||||
}
|
||||
|
||||
func (c *Controller) JoinShipGroupToFleet(actor, fleetName string, group, count uint) error {
|
||||
func (c *Controller) ShipGroupJoinFleet(actor, fleetName string, group, count uint) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -159,7 +159,7 @@ func (c *Controller) JoinShipGroupToFleet(actor, fleetName string, group, count
|
||||
return c.Cache.ShipGroupJoinFleet(ri, fleetName, group, count)
|
||||
}
|
||||
|
||||
func (c *Controller) JoinFleets(actor, fleetSourceName, fleetTargetName string) error {
|
||||
func (c *Controller) FleetMerge(actor, fleetSourceName, fleetTargetName string) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -167,7 +167,7 @@ func (c *Controller) JoinFleets(actor, fleetSourceName, fleetTargetName string)
|
||||
return c.Cache.fleetMerge(ri, fleetSourceName, fleetTargetName)
|
||||
}
|
||||
|
||||
func (c *Controller) SendFleet(actor, fleetName string, planetNumber uint) error {
|
||||
func (c *Controller) FleetSend(actor, fleetName string, planetNumber uint) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -179,7 +179,7 @@ func (c *Controller) SendFleet(actor, fleetName string, planetNumber uint) error
|
||||
return c.Cache.FleetSend(ri, fi, planetNumber)
|
||||
}
|
||||
|
||||
func (c *Controller) CreateScience(actor, typeName string, drive, weapons, shields, cargo float64) error {
|
||||
func (c *Controller) ScienceCreate(actor, typeName string, drive, weapons, shields, cargo float64) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -187,7 +187,7 @@ func (c *Controller) CreateScience(actor, typeName string, drive, weapons, shiel
|
||||
return c.Cache.ScienceCreate(ri, typeName, drive, weapons, shields, cargo)
|
||||
}
|
||||
|
||||
func (c *Controller) DeleteScience(actor, typeName string) error {
|
||||
func (c *Controller) ScienceRemove(actor, typeName string) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -195,7 +195,7 @@ func (c *Controller) DeleteScience(actor, typeName string) error {
|
||||
return c.Cache.ScienceRemove(ri, typeName)
|
||||
}
|
||||
|
||||
func (c *Controller) RenamePlanet(actor string, planetNumber int, typeName string) error {
|
||||
func (c *Controller) PlanetRename(actor string, planetNumber int, typeName string) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -203,7 +203,7 @@ func (c *Controller) RenamePlanet(actor string, planetNumber int, typeName strin
|
||||
return c.Cache.PlanetRename(ri, planetNumber, typeName)
|
||||
}
|
||||
|
||||
func (c *Controller) PlanetProduction(actor string, planetNumber int, prodType, subject string) error {
|
||||
func (c *Controller) PlanetProduce(actor string, planetNumber int, prodType, subject string) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -232,7 +232,7 @@ func (c *Controller) PlanetProduction(actor string, planetNumber int, prodType,
|
||||
return c.Cache.PlanetProduce(ri, planetNumber, prod, subject)
|
||||
}
|
||||
|
||||
func (c *Controller) SetRoute(actor, loadType string, origin, destination uint) error {
|
||||
func (c *Controller) PlanetRouteSet(actor, loadType string, origin, destination uint) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -244,7 +244,7 @@ func (c *Controller) SetRoute(actor, loadType string, origin, destination uint)
|
||||
return c.Cache.PlanetRouteSet(ri, rt, origin, destination)
|
||||
}
|
||||
|
||||
func (c *Controller) RemoveRoute(actor, loadType string, origin uint) error {
|
||||
func (c *Controller) PlanetRouteRemove(actor, loadType string, origin uint) error {
|
||||
ri, err := c.Cache.validActor(actor)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user