Documentation ¶
Index ¶
- Constants
- func DeleteObject(id types.Id)
- func Find(t types.ObjectType, query bson.M) []bson.ObjectId
- func FindAll(t types.ObjectType) []bson.ObjectId
- func FindOne(t types.ObjectType, query bson.M) types.Id
- func Init(session Session, dbName string)
- func NewEffect(name string) types.Effect
- func Retrieve(id types.Id, typ types.ObjectType) types.Object
- func RetrieveObjects(t types.ObjectType, objects interface{})
- type Area
- type Character
- func (self *Character) AddSkill(id types.Id)
- func (self *Character) GetCapacity() int
- func (self *Character) GetHealth() int
- func (self *Character) GetHitPoints() int
- func (self *Character) GetName() string
- func (self *Character) GetRoomId() types.Id
- func (self *Character) GetSkills() []types.Id
- func (self *Character) GetStrength() int
- func (self *Character) HasSkill(id types.Id) bool
- func (self *Character) Heal(hitpoints int)
- func (self *Character) Hit(hitpoints int)
- func (self *Character) RemoveSkill(id types.Id)
- func (self *Character) SetHealth(health int)
- func (self *Character) SetHitPoints(hitpoints int)
- func (self *Character) SetName(name string)
- func (self *Character) SetRoomId(id types.Id)
- type Collection
- type Container
- type Database
- type DbObject
- type Effect
- func (self *Effect) GetCost() int
- func (self *Effect) GetName() string
- func (self *Effect) GetPower() int
- func (self *Effect) GetSpeed() int
- func (self *Effect) GetTime() int
- func (self *Effect) GetType() types.EffectKind
- func (self *Effect) GetVariance() int
- func (self *Effect) SetCost(cost int)
- func (self *Effect) SetName(name string)
- func (self *Effect) SetPower(power int)
- func (self *Effect) SetSpeed(speed int)
- func (self *Effect) SetTime(speed int)
- func (self *Effect) SetType(effectKind types.EffectKind)
- func (self *Effect) SetVariance(variance int)
- type Exit
- type Item
- func (self *Item) GetCapacity() int
- func (self *Item) GetContainerId() types.Id
- func (self *Item) GetName() string
- func (self *Item) GetTemplate() types.Template
- func (self *Item) GetTemplateId() types.Id
- func (self *Item) GetValue() int
- func (self *Item) IsLocked() bool
- func (self *Item) SetContainerId(id types.Id, from types.Id) bool
- func (self *Item) SetLocked(locked bool)
- type Iterator
- type MongoCollection
- func (mc MongoCollection) DropCollection() error
- func (mc MongoCollection) Find(selector interface{}) Query
- func (mc MongoCollection) FindId(id interface{}) Query
- func (mc MongoCollection) Remove(selector interface{}) error
- func (mc MongoCollection) RemoveId(id interface{}) error
- func (mc MongoCollection) UpdateId(id interface{}, change interface{}) error
- func (mc MongoCollection) UpsertId(id interface{}, change interface{}) error
- type MongoDatabase
- type MongoIterator
- type MongoQuery
- type MongoSession
- type Npc
- type Pc
- type Query
- type Room
- func (self *Room) GetAreaId() types.Id
- func (self *Room) GetDescription() string
- func (self *Room) GetExits() []types.Direction
- func (self *Room) GetLinks() map[string]types.Id
- func (self *Room) GetLocation() types.Coordinate
- func (self *Room) GetTitle() string
- func (self *Room) GetZoneId() types.Id
- func (self *Room) HasExit(dir types.Direction) bool
- func (self *Room) IsLocked(dir types.Direction) bool
- func (self *Room) LinkNames() []string
- func (self *Room) NextLocation(direction types.Direction) types.Coordinate
- func (self *Room) RemoveLink(name string)
- func (self *Room) SetAreaId(areaId types.Id)
- func (self *Room) SetDescription(description string)
- func (self *Room) SetExitEnabled(dir types.Direction, enabled bool)
- func (self *Room) SetLink(name string, roomId types.Id)
- func (self *Room) SetLocation(location types.Coordinate)
- func (self *Room) SetLocked(dir types.Direction, locked bool)
- func (self *Room) SetTitle(title string)
- func (self *Room) SetZoneId(zoneId types.Id)
- type Session
- type Skill
- type Spawner
- type Store
- type Template
- func (self *Template) GetCapacity() int
- func (self *Template) GetName() string
- func (self *Template) GetValue() int
- func (self *Template) GetWeight() int
- func (self *Template) SetCapacity(capacity int)
- func (self *Template) SetName(name string)
- func (self *Template) SetValue(value int)
- func (self *Template) SetWeight(weight int)
- type User
- func (self *User) GetColorMode() types.ColorMode
- func (self *User) GetConnection() net.Conn
- func (self *User) GetInput(prompt string) string
- func (self *User) GetName() string
- func (self *User) GetPassword() []byte
- func (self *User) GetTerminalType() string
- func (self *User) GetWindowSize() (width int, height int)
- func (self *User) IsAdmin() bool
- func (self *User) IsOnline() bool
- func (self *User) SetAdmin(admin bool)
- func (self *User) SetColorMode(cm types.ColorMode)
- func (self *User) SetConnection(conn net.Conn)
- func (self *User) SetName(name string)
- func (self *User) SetOnline(online bool)
- func (self *User) SetPassword(password string)
- func (self *User) SetTerminalType(tt string)
- func (self *User) SetWindowSize(width int, height int)
- func (self *User) VerifyPassword(password string) bool
- func (self *User) Write(text string)
- func (self *User) WriteLine(line string, a ...interface{})
- type World
- type Zone
Constants ¶
View Source
const MinHeight = 20
View Source
const MinWidth = 60
Variables ¶
This section is empty.
Functions ¶
func DeleteObject ¶
func RetrieveObjects ¶
func RetrieveObjects(t types.ObjectType, objects interface{})
Types ¶
type Character ¶
type Character struct { Container `bson:",inline"` RoomId types.Id `bson:",omitempty"` Name string HitPoints int Skills utils.Set Strength int Vitality int }
func (*Character) GetCapacity ¶
func (*Character) GetHitPoints ¶
func (*Character) GetStrength ¶
func (*Character) RemoveSkill ¶
func (*Character) SetHitPoints ¶
type Collection ¶
type Container ¶
func (*Container) GetCapacity ¶
func (*Container) RemoveCash ¶
func (*Container) SetCapacity ¶
type Database ¶
type Database interface {
C(string) Collection
}
type DbObject ¶
func (*DbObject) IsDestroyed ¶
func (*DbObject) ReadUnlock ¶
func (self *DbObject) ReadUnlock()
func (*DbObject) WriteUnlock ¶
func (self *DbObject) WriteUnlock()
type Effect ¶
type Effect struct { DbObject `bson:",inline"` Type types.EffectKind Name string Power int Cost int Variance int Speed int Time int }
func (*Effect) GetType ¶
func (self *Effect) GetType() types.EffectKind
func (*Effect) GetVariance ¶
func (*Effect) SetType ¶
func (self *Effect) SetType(effectKind types.EffectKind)
func (*Effect) SetVariance ¶
type Item ¶
type Item struct { Container `bson:",inline"` TemplateId types.Id Locked bool ContainerId types.Id }
func (*Item) GetCapacity ¶
func (*Item) GetContainerId ¶
func (*Item) GetTemplate ¶
func (*Item) GetTemplateId ¶
type MongoCollection ¶
type MongoCollection struct {
// contains filtered or unexported fields
}
func (MongoCollection) DropCollection ¶
func (mc MongoCollection) DropCollection() error
func (MongoCollection) Find ¶
func (mc MongoCollection) Find(selector interface{}) Query
func (MongoCollection) FindId ¶
func (mc MongoCollection) FindId(id interface{}) Query
func (MongoCollection) Remove ¶
func (mc MongoCollection) Remove(selector interface{}) error
func (MongoCollection) RemoveId ¶
func (mc MongoCollection) RemoveId(id interface{}) error
func (MongoCollection) UpdateId ¶
func (mc MongoCollection) UpdateId(id interface{}, change interface{}) error
func (MongoCollection) UpsertId ¶
func (mc MongoCollection) UpsertId(id interface{}, change interface{}) error
type MongoDatabase ¶
type MongoDatabase struct {
// contains filtered or unexported fields
}
func (MongoDatabase) C ¶
func (md MongoDatabase) C(collectionName string) Collection
type MongoIterator ¶
type MongoIterator struct {
// contains filtered or unexported fields
}
func (MongoIterator) All ¶
func (mi MongoIterator) All(result interface{}) error
type MongoQuery ¶
type MongoQuery struct {
// contains filtered or unexported fields
}
func (MongoQuery) Count ¶
func (mq MongoQuery) Count() (int, error)
func (MongoQuery) Iter ¶
func (mq MongoQuery) Iter() Iterator
func (MongoQuery) One ¶
func (mq MongoQuery) One(result interface{}) error
type MongoSession ¶
type MongoSession struct {
// contains filtered or unexported fields
}
func NewMongoSession ¶
func NewMongoSession(session *mgo.Session) *MongoSession
func (MongoSession) DB ¶
func (ms MongoSession) DB(dbName string) Database
type Npc ¶
type Npc struct { Character `bson:",inline"` SpawnerId types.Id `bson:",omitempty"` Roaming bool Conversation string }
func (*Npc) GetConversation ¶
func (*Npc) GetRoaming ¶
func (*Npc) PrettyConversation ¶
func (*Npc) SetConversation ¶
func (*Npc) SetRoaming ¶
type Pc ¶
type Room ¶
type Room struct { Container `bson:",inline"` ZoneId types.Id AreaId types.Id `bson:",omitempty"` Title string Description string Links map[string]types.Id Location types.Coordinate Exits map[types.Direction]*Exit }
func (*Room) GetDescription ¶
func (*Room) GetLocation ¶
func (self *Room) GetLocation() types.Coordinate
func (*Room) NextLocation ¶
func (self *Room) NextLocation(direction types.Direction) types.Coordinate
func (*Room) RemoveLink ¶
func (*Room) SetDescription ¶
func (*Room) SetLocation ¶
func (self *Room) SetLocation(location types.Coordinate)
type User ¶
type User struct { DbObject `bson:",inline"` Name string ColorMode types.ColorMode Password []byte Admin bool // contains filtered or unexported fields }
func (*User) GetColorMode ¶
func (*User) GetConnection ¶
func (*User) GetPassword ¶
GetPassword returns the SHA1 of the user's password
func (*User) GetTerminalType ¶
func (*User) GetWindowSize ¶
func (*User) SetColorMode ¶
func (*User) SetConnection ¶
func (*User) SetPassword ¶
SetPassword SHA1 hashes the password before saving it to the database
func (*User) SetTerminalType ¶
func (*User) SetWindowSize ¶
func (*User) VerifyPassword ¶
type World ¶
func (*World) AdvanceTime ¶
func (self *World) AdvanceTime()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.