ET framework---MatcherComponent study notes

MatcherComponent

Please follow me on Weibo: @NormanLin_BadPixel Bad Pixel


This is the component that manages match objects.

private readonly Dictionary<long, Matcher> matchers = new Dictionary<long, Matcher>();

Getting the number of matched objects simply returns the length of the dictionary.

When we look at the method of adding a match object, we can know that the key of the mathers dictionary is Matcher.UserID and the value is the Matcher object.

public void Add(Matcher matcher)
{
    this.matchers.Add(matcher.UserID, matcher);
}

Of course, it also provides a method to obtain matching objects based on IDs .

Of course, there are many ways to remove the object, but the method to remove the object here is not only to remove the object with the specified id , but also to return the object. Just like Queen.Dequeue .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325815581&siteId=291194637