Пример #1
0
func (self SayEvent) ToString(receiver *database.Character) string {
	who := ""
	if receiver.GetId() == self.Character.GetId() {
		who = "You say"
	} else {
		who = self.Character.GetName() + " says"
	}

	return utils.Colorize(utils.ColorBlue, who+", ") +
		utils.Colorize(utils.ColorWhite, "\""+self.Message+"\"")
}
Пример #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
}
Пример #3
0
func (self LoginEvent) IsFor(receiver *database.Character) bool {
	return receiver.GetId() != self.Character.GetId()
}
Пример #4
0
func (self LeaveEvent) IsFor(receiver *database.Character) bool {
	return receiver.GetRoomId() == self.Room.GetId() &&
		receiver.GetId() != self.Character.GetId()
}
Пример #5
0
func (self TellEvent) IsFor(receiver *database.Character) bool {
	return receiver.GetId() == self.To.GetId()
}