Example #1
0
 //this is a helper function to prune duplicate entries from the packet data
 public bool ActorExists(Actor actor)
 {
     return Actors.Any(
         t =>
             t.SnoId == actor.SnoId && 
             t.Position.X == actor.Position.X && 
             t.Position.Y == actor.Position.Y &&
             t.Position.Z == actor.Position.Z);
 }
Example #2
0
 public void AddActor(string line)
 {
     var actor = new Actor();
     if (!actor.ParseFrom(this.WorldID, line)) return; // if not valid actor (inventory using items), just don't add it to list.            
     if(!this.ActorExists(actor)) Actors.Add(actor); // filter duplicate actors.
 }