Beispiel #1
0
func (self LeaveEvent) ToString(receiver *database.Character) string {
	str := fmt.Sprintf("%v%s %vhas left the room", utils.ColorBlue, self.Character.GetName(), utils.ColorWhite)

	dir := DirectionBetween(self.Room, self.DestRoom)
	if dir != database.DirectionNone {
		str = str + " to the " + database.DirectionToString(dir)
	}

	return str
}
Beispiel #2
0
func (self EnterEvent) ToString(receiver *database.Character) string {
	if receiver.GetId() == self.Character.GetId() {
		return ""
	}

	str := fmt.Sprintf("%v%s %vhas entered the room", utils.ColorBlue, self.Character.GetName(), utils.ColorWhite)

	dir := DirectionBetween(self.Room, self.SourceRoom)
	if dir != database.DirectionNone {
		str = str + " from the " + database.DirectionToString(dir)
	}

	return str
}