You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
789 B
Go
39 lines
789 B
Go
package main
|
|
|
|
import (
|
|
"database/sql"
|
|
"fmt"
|
|
)
|
|
|
|
type Area struct {
|
|
Uid, Name, Flags, Color, Texture sql.NullString
|
|
}
|
|
|
|
type Room struct {
|
|
Uid, Name, Building, Info, Notes, Flags sql.NullString
|
|
Area Area
|
|
AreaName sql.NullString
|
|
Norecall, Noportal sql.NullInt64
|
|
Exits []Exit
|
|
}
|
|
|
|
func (r Room) String() string {
|
|
return fmt.Sprintf("{Room:%q[%q]}", r.Name.String, r.Uid.String)
|
|
}
|
|
|
|
type Exit struct {
|
|
Dir sql.NullString
|
|
Fromuid, Touid sql.NullString
|
|
Level int
|
|
}
|
|
|
|
type RoomExit struct {
|
|
Room
|
|
Exit
|
|
}
|
|
|
|
func (re RoomExit) String() string {
|
|
|
|
return fmt.Sprintf("[%s(%s) |%s> %s]", re.Name.String, re.Uid.String, re.Dir.String, re.Touid.String)
|
|
}
|