static void AddGossipToOutput(NpcShouts output, Gossip gossip) { if (gossip.NpcList.Count == 0) { var matchedEntry = output.NpcList.Where(g => g.npcid == 0).FirstOrDefault(); if (matchedEntry == null) matchedEntry = new NpcShoutData(); matchedEntry.ShoutList.Add(new Shout() { messageid = gossip.stringId, @event = gossip.Event, param = gossip.param }); output.NpcList.Remove(matchedEntry); output.NpcList.Add(matchedEntry); return; } foreach (var npc in gossip.NpcList) { var matchedEntry = output.NpcList.Where(g => g.npcid == npc).FirstOrDefault(); if (matchedEntry == null) { matchedEntry = new NpcShoutData(); matchedEntry.npcid = npc; } matchedEntry.ShoutList.Add(new Shout() { messageid = gossip.stringId, @event = gossip.Event, param = gossip.param }); output.NpcList.Remove(matchedEntry); output.NpcList.Add(matchedEntry); } }
static void AddGossipToOutput(NpcShouts output, Gossip gossip) { if (gossip.NpcList.Count == 0) { var matchedEntry = output.NpcList.Where(g => g.npcid == 0).FirstOrDefault(); if (matchedEntry == null) { matchedEntry = new NpcShoutData(); } matchedEntry.ShoutList.Add(new Shout() { messageid = gossip.stringId, @event = gossip.Event, param = gossip.param }); output.NpcList.Remove(matchedEntry); output.NpcList.Add(matchedEntry); return; } foreach (var npc in gossip.NpcList) { var matchedEntry = output.NpcList.Where(g => g.npcid == npc).FirstOrDefault(); if (matchedEntry == null) { matchedEntry = new NpcShoutData(); matchedEntry.npcid = npc; } matchedEntry.ShoutList.Add(new Shout() { messageid = gossip.stringId, @event = gossip.Event, param = gossip.param }); output.NpcList.Remove(matchedEntry); output.NpcList.Add(matchedEntry); } }