private static ModuleConnector GetRandomExitWithTag(Module module, TileTagsEnum tagToMatch) { var possibleExits = module.GetExits(); var matchingExits = possibleExits.Where(e => (e.hasTag(tagToMatch))); return(Helper.GetRandom <ModuleConnector>(matchingExits.ToArray())); }
public bool hasTag(TileTagsEnum tag) { return((tags & tag) != TileTagsEnum.None); }