Documentation
¶
Index ¶
- func Apply(p *Player, params []string) string
- func Clothe(p *Player, params []string) string
- func Go(p *Player, params []string) string
- func LookAround(p *Player, _ []string) string
- func Take(p *Player, params []string) string
- type AbstractLocation
- func (a *AbstractLocation) AddAvailableLocation(location Location, barrier BarrierInterface)
- func (a *AbstractLocation) AddEntryLocation(location Location)
- func (a *AbstractLocation) AvailableLocations() []Location
- func (a *AbstractLocation) AvailableLocationsNames() string
- func (a *AbstractLocation) DeleteInventory(inventory *Inventory) bool
- func (a *AbstractLocation) Description() string
- func (a *AbstractLocation) DescriptionAndAvailableLocations() string
- func (a *AbstractLocation) GetAvailableLocationFor(locationName string) Location
- func (a *AbstractLocation) GetInventories() []*Inventory
- func (a *AbstractLocation) InventoriesAndAvailableLocations() string
- func (a *AbstractLocation) Name() string
- type Barrier
- type BarrierInterface
- type Furniture
- type House
- type Inventory
- type Location
- type Player
- type Room
- type Street
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookAround ¶
LookAround command: description from the location + some else
Types ¶
type AbstractLocation ¶
type AbstractLocation struct {
Location
// contains filtered or unexported fields
}
AbstractLocation struct
func (*AbstractLocation) AddAvailableLocation ¶
func (a *AbstractLocation) AddAvailableLocation(location Location, barrier BarrierInterface)
AddAvailableLocation add available location
func (*AbstractLocation) AddEntryLocation ¶
func (a *AbstractLocation) AddEntryLocation(location Location)
AddEntryLocation add entry location
func (*AbstractLocation) AvailableLocations ¶
func (a *AbstractLocation) AvailableLocations() []Location
AvailableLocations returns available locations
func (*AbstractLocation) AvailableLocationsNames ¶
func (a *AbstractLocation) AvailableLocationsNames() string
AvailableLocationsNames returns available locations names
func (*AbstractLocation) DeleteInventory ¶
func (a *AbstractLocation) DeleteInventory(inventory *Inventory) bool
DeleteInventory remove inventory
func (*AbstractLocation) Description ¶
func (a *AbstractLocation) Description() string
Description returns description
func (*AbstractLocation) DescriptionAndAvailableLocations ¶
func (a *AbstractLocation) DescriptionAndAvailableLocations() string
DescriptionAndAvailableLocations returns description and available locations
func (*AbstractLocation) GetAvailableLocationFor ¶
func (a *AbstractLocation) GetAvailableLocationFor(locationName string) Location
GetAvailableLocationFor returns matched location
func (*AbstractLocation) GetInventories ¶
func (a *AbstractLocation) GetInventories() []*Inventory
GetInventories returns inventories
func (*AbstractLocation) InventoriesAndAvailableLocations ¶
func (a *AbstractLocation) InventoriesAndAvailableLocations() string
InventoriesAndAvailableLocations returns description and available locations
type House ¶
type House struct {
AbstractLocation
}
House returns location struct
func (*House) EntryLocation ¶
EntryLocation returns entry location
type Inventory ¶
type Inventory struct {
Name string
Clotheable bool
CanAddInventories bool
Takeable bool
ApplicableTo string
Inventories []*Inventory
}
Inventory struct
type Location ¶
type Location interface {
Name() string
Description() string
AvailableLocations() []Location
AddAvailableLocation(Location, BarrierInterface)
GetAvailableLocationFor(string) Location
DescriptionAndAvailableLocations() string
InventoriesAndAvailableLocations() string
GetInventories() []*Inventory
DeleteInventory(*Inventory) bool
AddEntryLocation(location Location)
EntryLocation() Location
}
Location interface
type Player ¶
Player returns player struct
func (*Player) HandleInput ¶
HandleInput parsed comand and interected player
type Room ¶
type Room struct {
AbstractLocation
// contains filtered or unexported fields
}
Room returns location struct
func (*Room) DescriptionAndAvailableLocations ¶
DescriptionAndAvailableLocations returns room description and available locations
func (*Room) EntryLocation ¶
EntryLocation returns entry location
func (*Room) InventoriesAndAvailableLocations ¶
InventoriesAndAvailableLocations returns room description and available locations
type Street ¶
type Street struct {
AbstractLocation
}
Street returns location struct
func (*Street) EntryLocation ¶
EntryLocation returns entry location