Documentation
¶
Overview ¶
This package manages the world Supported actions: handling the cities lists, generating new world, load database of cities
Index ¶
- func GetNumOfDestroyedCities(listOfCities Cities) int64
- func PrintAllCities(listOfCities Cities)
- type Cities
- type City
- func (c *City) Enter(invaderName string)
- func (c *City) GetEast() *City
- func (c *City) GetInvaderNames() []string
- func (c *City) GetName() string
- func (c *City) GetNorth() *City
- func (c *City) GetSouth() *City
- func (c *City) GetWest() *City
- func (c *City) IsDestroyed() bool
- func (c *City) Leave(invaderName string)
- func (c *City) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNumOfDestroyedCities ¶
This function counts and returns the number of destroyed cities
func PrintAllCities ¶
func PrintAllCities(listOfCities Cities)
This function receives a slice of cities and prints them all,
Types ¶
type Cities ¶
type Cities []*City
type City ¶
type City struct {
// contains filtered or unexported fields
}
func (*City) Enter ¶
This function is called once the city is visited by an alien The invasion result can happen here
func (*City) GetInvaderNames ¶
func (*City) IsDestroyed ¶
Click to show internal directories.
Click to hide internal directories.