<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.wlabsocks.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Role%3ACreate</id>
	<title>Role:Create - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.wlabsocks.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Role%3ACreate"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=Role:Create&amp;action=history"/>
	<updated>2026-04-17T07:11:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>http://www.wlabsocks.com/wiki/index.php?title=Role:Create&amp;diff=1208&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;= Role Management in Systems =  == Overview == The &lt;code&gt;Role&lt;/code&gt; class facilitates the dynamic creation and integration of roles within a system, providing a structured approach to defining roles with specific attributes. This guide outlines the method for creating roles, emphasizing their uniqueness and the significance of attributes such as gender-specific titles, inheritance, and hierarchical placement.  == Method Overview ==  === Create === This method creates a...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=Role:Create&amp;diff=1208&amp;oldid=prev"/>
		<updated>2024-03-03T12:07:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Role Management in Systems =  == Overview == The &amp;lt;code&amp;gt;Role&amp;lt;/code&amp;gt; class facilitates the dynamic creation and integration of roles within a system, providing a structured approach to defining roles with specific attributes. This guide outlines the method for creating roles, emphasizing their uniqueness and the significance of attributes such as gender-specific titles, inheritance, and hierarchical placement.  == Method Overview ==  === Create === This method creates a...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Role Management in Systems =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Role&amp;lt;/code&amp;gt; class facilitates the dynamic creation and integration of roles within a system, providing a structured approach to defining roles with specific attributes. This guide outlines the method for creating roles, emphasizing their uniqueness and the significance of attributes such as gender-specific titles, inheritance, and hierarchical placement.&lt;br /&gt;
&lt;br /&gt;
== Method Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Create ===&lt;br /&gt;
This method creates a new role or retrieves an existing one based on the provided name, ensuring no duplication within the system. It supports detailed customization, including gender-specific titles and visual representation through icons.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
public static Role Create(&lt;br /&gt;
    string roleName,&lt;br /&gt;
    string description,&lt;br /&gt;
    Sprite icon = null,&lt;br /&gt;
    int capacity = 1,&lt;br /&gt;
    string titleForMale = null,&lt;br /&gt;
    string titleForFemale = null,&lt;br /&gt;
    bool inheritance = false,&lt;br /&gt;
    int priority = 0,&lt;br /&gt;
    string filterNameOrId = null&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Parameters ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;roleName&amp;lt;/code&amp;gt;: Unique identifier for the role.&lt;br /&gt;
* &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt;: Brief overview of the role's responsibilities or significance.&lt;br /&gt;
* &amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt;: (Optional) Visual representation for the role.&lt;br /&gt;
* &amp;lt;code&amp;gt;capacity&amp;lt;/code&amp;gt;: (Optional) Maximum number of actors that can assume the role simultaneously.&lt;br /&gt;
* &amp;lt;code&amp;gt;titleForMale&amp;lt;/code&amp;gt;: (Optional) Title for male actors.&lt;br /&gt;
* &amp;lt;code&amp;gt;titleForFemale&amp;lt;/code&amp;gt;: (Optional) Title for female actors.&lt;br /&gt;
* &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt;: (Optional) Specifies if the role is inheritable.&lt;br /&gt;
* &amp;lt;code&amp;gt;priority&amp;lt;/code&amp;gt;: (Optional) Determines the role's hierarchical rank.&lt;br /&gt;
* &amp;lt;code&amp;gt;filterNameOrId&amp;lt;/code&amp;gt;: (Optional) Associates the role with a specific heir filter for inheritance logic.&lt;br /&gt;
&lt;br /&gt;
==== Returns ====&lt;br /&gt;
An existing role if one with the same name is found; otherwise, a newly instantiated Role object.&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
In the provided example, a new role named &amp;quot;Leader&amp;quot; is created with distinct titles for male and female actors, an icon for visual representation, a capacity for three individuals to hold the role within any group, and the highest priority level to signify its importance. This role is also inheritable and associated with a specific filter for determining heir eligibility.&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using Nullframes.Intrigues;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
&lt;br /&gt;
public class Runtime : MonoBehaviour {&lt;br /&gt;
    public Sprite icon;&lt;br /&gt;
&lt;br /&gt;
    private void Start() {&lt;br /&gt;
        CreateNewRole();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private void CreateNewRole() {&lt;br /&gt;
        Role role = Role.Create(&lt;br /&gt;
            roleName: &amp;quot;Leader&amp;quot;, &lt;br /&gt;
            description: &amp;quot;Leads the group and makes critical decisions.&amp;quot;, &lt;br /&gt;
            icon: icon, &lt;br /&gt;
            capacity: 3, &lt;br /&gt;
            titleForMale: &amp;quot;King&amp;quot;, &lt;br /&gt;
            titleForFemale: &amp;quot;Queen&amp;quot;, &lt;br /&gt;
            inheritance: true, &lt;br /&gt;
            priority: 99, &lt;br /&gt;
            filterNameOrId: &amp;quot;Leader Filter&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
        &lt;br /&gt;
        // Example of setting the role for a player or actor.&lt;br /&gt;
        IM.Player.SetRole(role);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Role&amp;lt;/code&amp;gt; class and its &amp;lt;code&amp;gt;Create&amp;lt;/code&amp;gt; method offer a comprehensive approach to role management within a system, ensuring roles are uniquely identified and correctly integrated. Through detailed attributes, roles can be designed to fit various system requirements, from defining gender-specific titles to establishing inheritance logic and hierarchical order.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>