BWF is a multi-manager for all available managers. More...
Public Member Functions | |
delegate void | BWFReady () |
void | Load (Model.Enum.ManagerMask mask=Model.Enum.ManagerMask.All) |
Loads the filter of a manager. More... | |
System.Collections.Generic.List< Data.Source > | Sources (Model.Enum.ManagerMask mask=Model.Enum.ManagerMask.All) |
Returns all sources for a manager. More... | |
bool | Contains (string text, Model.Enum.ManagerMask mask=Model.Enum.ManagerMask.All, params string[] sourceNames) |
Searches for unwanted words in a text. More... | |
void | ContainsAsync (string text, Model.Enum.ManagerMask mask=Model.Enum.ManagerMask.All, params string[] sourceNames) |
Searches asynchronously for unwanted words in a text. Use the "OnContainsComplete"-callback to get the result. More... | |
System.Collections.Generic.List< string > | GetAll (string text, Model.Enum.ManagerMask mask=Model.Enum.ManagerMask.All, params string[] sourceNames) |
Searches for unwanted words in a text. More... | |
void | GetAllAsync (string text, Model.Enum.ManagerMask mask=Model.Enum.ManagerMask.All, params string[] sourceNames) |
Searches asynchronously for unwanted words in a text. Use the "OnGetAllComplete"-callback to get the result. More... | |
string | ReplaceAll (string text, Model.Enum.ManagerMask mask=Model.Enum.ManagerMask.All, params string[] sourceNames) |
Searches and replaces all unwanted words in a text. More... | |
string | ReplaceAll (string text, Model.Enum.ManagerMask mask, bool markOnly, string prefix, string postfix, params string[] sourceNames) |
Searches and replaces all unwanted words in a text. More... | |
void | ReplaceAllAsync (string text, Model.Enum.ManagerMask mask=Model.Enum.ManagerMask.All, params string[] sourceNames) |
Searches and replaces asynchronously all unwanted words in a text. Use the "OnReplaceAllComplete"-callback to get the result. More... | |
void | ReplaceAllAsync (string text, Model.Enum.ManagerMask mask, bool markOnly, string prefix, string postfix, params string[] sourceNames) |
Searches and replaces asynchronously all unwanted words in a text. Use the "OnReplaceAllComplete"-callback to get the result. More... | |
string | Mark (string text, System.Collections.Generic.List< string > unwantedWords, string prefix="<b><color=red>", string postfix="</color></b>") |
Marks the text with a prefix and postfix from a list of words. Use this method if you already have a list of bad words (e.g. from the 'GetAll()' method). More... | |
string | Mark (string text, bool replace=false, string prefix="<b><color=red>", string postfix="</color></b>", Model.Enum.ManagerMask mask=Model.Enum.ManagerMask.All, params string[] sourceNames) |
Marks the text with a prefix and postfix. More... | |
string | Unmark (string text, string prefix="<b><color=red>", string postfix="</color></b>") |
Unmarks the text with a prefix and postfix. More... | |
Public Attributes | |
bool | DisableOrdering |
bool | isReady |
Checks the readiness status of all managers. More... | |
int | TotalRegexCount => Sources().Sum(src => src.RegexCount) |
Total number of Regex. More... | |
OnReady | OnReady |
OnContainsCompleted | OnContainsCompleted |
OnGetAllCompleted | OnGetAllCompleted |
OnReplaceAllCompleted | OnReplaceAllCompleted |
Protected Member Functions | |
override void | OnApplicationQuit () |
Protected Member Functions inherited from Crosstales.Common.Util.Singleton< BWFManager > | |
virtual void | Awake () |
virtual void | OnDestroy () |
Events | |
BWFReady | OnBWFReady |
An event triggered whenever BWF is ready. More... | |
ContainsComplete | OnContainsComplete |
An event triggered whenever the "Contains"-operation is completed. More... | |
GetAllComplete | OnGetAllComplete |
An event triggered whenever the "GetAll"-operation is completed. More... | |
ReplaceAllComplete | OnReplaceAllComplete |
An event triggered whenever the "ReplaceAll"-operation is completed. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Crosstales.Common.Util.Singleton< BWFManager > | |
static void | CreateInstance (bool searchExistingGameObject=true, bool deleteExistingInstance=false) |
Creates an instance of this object. More... | |
static void | DeleteInstance () |
Deletes the instance of this object. More... | |
Static Public Attributes inherited from Crosstales.Common.Util.Singleton< BWFManager > | |
static string | PrefabPath |
Fully qualified prefab path. More... | |
static string | GameObjectName |
Name of the gameobject in the scene. More... | |
Static Protected Attributes inherited from Crosstales.Common.Util.Singleton< BWFManager > | |
static T | instance |
Properties inherited from Crosstales.Common.Util.Singleton< BWFManager > | |
static T | Instance [get, protected set] |
Returns the singleton instance of this class. More... | |
bool | DontDestroy [get, set] |
Don't destroy gameobject during scene switches. More... | |
Detailed Description
BWF is a multi-manager for all available managers.
Member Function Documentation
◆ Contains()
bool Crosstales.BWF.BWFManager.Contains | ( | string | text, |
Model.Enum.ManagerMask | mask = Model.Enum.ManagerMask.All , |
||
params string[] | sourceNames | ||
) |
Searches for unwanted words in a text.
- Parameters
-
text Text to check mask Active manager (default: Model.Enum.ManagerMask.All, optional) sourceNames Relevant sources (e.g. "english", optional)
- Returns
- True if a match was found
NUnit
◆ ContainsAsync()
void Crosstales.BWF.BWFManager.ContainsAsync | ( | string | text, |
Model.Enum.ManagerMask | mask = Model.Enum.ManagerMask.All , |
||
params string[] | sourceNames | ||
) |
Searches asynchronously for unwanted words in a text. Use the "OnContainsComplete"-callback to get the result.
- Parameters
-
text Text to check mask Active manager (default: Model.Enum.ManagerMask.All, optional) sourceNames Relevant sources (e.g. "english", optional)
◆ GetAll()
System.Collections.Generic.List<string> Crosstales.BWF.BWFManager.GetAll | ( | string | text, |
Model.Enum.ManagerMask | mask = Model.Enum.ManagerMask.All , |
||
params string[] | sourceNames | ||
) |
Searches for unwanted words in a text.
- Parameters
-
text Text to check mask Active manager (default: Model.Enum.ManagerMask.All, optional) sourceNames Relevant sources (e.g. "english", optional)
- Returns
- List with all the matches
◆ GetAllAsync()
void Crosstales.BWF.BWFManager.GetAllAsync | ( | string | text, |
Model.Enum.ManagerMask | mask = Model.Enum.ManagerMask.All , |
||
params string[] | sourceNames | ||
) |
Searches asynchronously for unwanted words in a text. Use the "OnGetAllComplete"-callback to get the result.
- Parameters
-
text Text to check mask Active manager (default: Model.Enum.ManagerMask.All, optional) sourceNames Relevant sources (e.g. "english", optional)
◆ Load()
void Crosstales.BWF.BWFManager.Load | ( | Model.Enum.ManagerMask | mask = Model.Enum.ManagerMask.All | ) |
Loads the filter of a manager.
- Parameters
-
mask Active manager (default: ManagerMask.All, optional)
◆ Mark() [1/2]
string Crosstales.BWF.BWFManager.Mark | ( | string | text, |
bool | replace = false , |
||
string | prefix = "<b><color=red>" , |
||
string | postfix = "</color></b>" , |
||
Model.Enum.ManagerMask | mask = Model.Enum.ManagerMask.All , |
||
params string[] | sourceNames | ||
) |
Marks the text with a prefix and postfix.
- Parameters
-
text Text containing unwanted words replace Replace the bad words (default: false, optional) prefix Prefix for every found unwanted word (optional) postfix Postfix for every found unwanted word (optional) mask Active manager (default: Model.Enum.ManagerMask.All, optional) sourceNames Relevant sources (e.g. "english", optional)
- Returns
- Clean text
◆ Mark() [2/2]
string Crosstales.BWF.BWFManager.Mark | ( | string | text, |
System.Collections.Generic.List< string > | unwantedWords, | ||
string | prefix = "<b><color=red>" , |
||
string | postfix = "</color></b>" |
||
) |
Marks the text with a prefix and postfix from a list of words. Use this method if you already have a list of bad words (e.g. from the 'GetAll()' method).
- Parameters
-
text Text containing unwanted words unwantedWords Unwanted words to mark prefix Prefix for every found unwanted word (optional) postfix Postfix for every found unwanted word (optional)
- Returns
- Text with marked unwanted words
◆ ReplaceAll() [1/2]
string Crosstales.BWF.BWFManager.ReplaceAll | ( | string | text, |
Model.Enum.ManagerMask | mask, | ||
bool | markOnly, | ||
string | prefix, | ||
string | postfix, | ||
params string[] | sourceNames | ||
) |
Searches and replaces all unwanted words in a text.
- Parameters
-
text Text to check mask Active manager (default: Model.Enum.ManagerMask.All, optional) markOnly Only mark the words (default: false, optional) prefix Prefix for every found bad word (optional) postfix Postfix for every found bad word (optional) sourceNames Relevant sources (e.g. "english", optional)
- Returns
- Clean text
◆ ReplaceAll() [2/2]
string Crosstales.BWF.BWFManager.ReplaceAll | ( | string | text, |
Model.Enum.ManagerMask | mask = Model.Enum.ManagerMask.All , |
||
params string[] | sourceNames | ||
) |
Searches and replaces all unwanted words in a text.
- Parameters
-
text Text to check mask Active manager (default: Model.Enum.ManagerMask.All, optional) sourceNames Relevant sources (e.g. "english", optional)
- Returns
- Clean text
◆ ReplaceAllAsync() [1/2]
void Crosstales.BWF.BWFManager.ReplaceAllAsync | ( | string | text, |
Model.Enum.ManagerMask | mask, | ||
bool | markOnly, | ||
string | prefix, | ||
string | postfix, | ||
params string[] | sourceNames | ||
) |
Searches and replaces asynchronously all unwanted words in a text. Use the "OnReplaceAllComplete"-callback to get the result.
- Parameters
-
text Text to check mask Active manager (default: Model.Enum.ManagerMask.All) markOnly Only mark the words (default: false) prefix Prefix for every found bad word postfix Postfix for every found bad word sourceNames Relevant sources (e.g. "english")
◆ ReplaceAllAsync() [2/2]
void Crosstales.BWF.BWFManager.ReplaceAllAsync | ( | string | text, |
Model.Enum.ManagerMask | mask = Model.Enum.ManagerMask.All , |
||
params string[] | sourceNames | ||
) |
Searches and replaces asynchronously all unwanted words in a text. Use the "OnReplaceAllComplete"-callback to get the result.
- Parameters
-
text Text to check mask Active manager (default: Model.Enum.ManagerMask.All, optional) sourceNames Relevant sources (e.g. "english", optional)
◆ Sources()
System.Collections.Generic.List<Data.Source> Crosstales.BWF.BWFManager.Sources | ( | Model.Enum.ManagerMask | mask = Model.Enum.ManagerMask.All | ) |
Returns all sources for a manager.
- Parameters
-
mask Active manager (default: Model.Enum.ManagerMask.All, optional)
- Returns
- List with all sources for the selected manager
◆ Unmark()
string Crosstales.BWF.BWFManager.Unmark | ( | string | text, |
string | prefix = "<b><color=red>" , |
||
string | postfix = "</color></b>" |
||
) |
Unmarks the text with a prefix and postfix.
- Parameters
-
text Text with marked unwanted words prefix Prefix for every found unwanted word (optional) postfix Postfix for every found unwanted word (optional)
- Returns
- Text with unmarked unwanted words
Member Data Documentation
◆ isReady
bool Crosstales.BWF.BWFManager.isReady |
Checks the readiness status of all managers.
- Returns
- True if all managers are ready.
◆ TotalRegexCount
int Crosstales.BWF.BWFManager.TotalRegexCount => Sources().Sum(src => src.RegexCount) |
Total number of Regex.
- Returns
- Total number of Regex.
Event Documentation
◆ OnBWFReady
BWFReady Crosstales.BWF.BWFManager.OnBWFReady |
An event triggered whenever BWF is ready.
◆ OnContainsComplete
ContainsComplete Crosstales.BWF.BWFManager.OnContainsComplete |
An event triggered whenever the "Contains"-operation is completed.
◆ OnGetAllComplete
GetAllComplete Crosstales.BWF.BWFManager.OnGetAllComplete |
An event triggered whenever the "GetAll"-operation is completed.
◆ OnReplaceAllComplete
ReplaceAllComplete Crosstales.BWF.BWFManager.OnReplaceAllComplete |
An event triggered whenever the "ReplaceAll"-operation is completed.
The documentation for this class was generated from the following file:
- C:/Users/slaub/Unity/assets/BWFPro/BWFPro/Assets/Plugins/crosstales/BadWordFilter/Scripts/BWFManager.cs