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+"\"") }
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 }
func (self LoginEvent) IsFor(receiver *database.Character) bool { return receiver.GetId() != self.Character.GetId() }
func (self LeaveEvent) IsFor(receiver *database.Character) bool { return receiver.GetRoomId() == self.Room.GetId() && receiver.GetId() != self.Character.GetId() }
func (self TellEvent) IsFor(receiver *database.Character) bool { return receiver.GetId() == self.To.GetId() }