Ejemplo n.º 1
0
func DeleteUser(userId types.Id) {
	for _, character := range GetUserCharacters(userId) {
		DeleteCharacter(character.GetId())
	}

	db.DeleteObject(userId)
}
Ejemplo n.º 2
0
func DeleteRoom(room types.Room) {
	db.DeleteObject(room.GetId())

	// Disconnect all exits leading to this room
	loc := room.GetLocation()

	updateRoom := func(dir types.Direction) {
		next := loc.Next(dir)
		room := GetRoomByLocation(next, room.GetZoneId())

		if room != nil {
			room.SetExitEnabled(dir.Opposite(), false)
		}
	}

	updateRoom(types.DirectionNorth)
	updateRoom(types.DirectionNorthEast)
	updateRoom(types.DirectionEast)
	updateRoom(types.DirectionSouthEast)
	updateRoom(types.DirectionSouth)
	updateRoom(types.DirectionSouthWest)
	updateRoom(types.DirectionWest)
	updateRoom(types.DirectionNorthWest)
	updateRoom(types.DirectionUp)
	updateRoom(types.DirectionDown)
}
Ejemplo n.º 3
0
func DeleteZone(zoneId types.Id) {
	rooms := GetRoomsInZone(zoneId)

	for _, room := range rooms {
		DeleteRoom(room)
	}

	db.DeleteObject(zoneId)
}
Ejemplo n.º 4
0
func DeleteStore(id types.Id) {
	// TODO - Delete or drop items
	db.DeleteObject(id)
}
Ejemplo n.º 5
0
func DeleteSkill(id types.Id) {
	db.DeleteObject(id)
}
Ejemplo n.º 6
0
func DeleteItem(itemId types.Id) {
	db.DeleteObject(itemId)
}
Ejemplo n.º 7
0
func DeleteArea(areaId types.Id) {
	// TODO - Remove room references to area
	db.DeleteObject(areaId)
}
Ejemplo n.º 8
0
func DeleteCharacter(charId types.Id) {
	// TODO: Delete (or drop) inventory
	db.DeleteObject(charId)
}