<?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=Policy%3ACreate</id>
	<title>Policy: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=Policy%3ACreate"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=Policy:Create&amp;action=history"/>
	<updated>2026-05-06T01:03:16Z</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=Policy:Create&amp;diff=1207&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;= Policy Creation Documentation =  == Overview == The &lt;code&gt;Policy&lt;/code&gt; class is designed to create and manage policies within the system. This documentation outlines the &lt;code&gt;Create&lt;/code&gt; method, detailing its purpose, usage, parameters, and return values. Policies are key components in systems requiring rules or guidelines that entities must follow.  == Create Method ==  === Description === The &lt;code&gt;Create&lt;/code&gt; method allows for the instantiation of a new policy...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=Policy:Create&amp;diff=1207&amp;oldid=prev"/>
		<updated>2024-03-03T11:53:31Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Policy Creation Documentation =  == Overview == The &amp;lt;code&amp;gt;Policy&amp;lt;/code&amp;gt; class is designed to create and manage policies within the system. This documentation outlines the &amp;lt;code&amp;gt;Create&amp;lt;/code&amp;gt; method, detailing its purpose, usage, parameters, and return values. Policies are key components in systems requiring rules or guidelines that entities must follow.  == Create Method ==  === Description === The &amp;lt;code&amp;gt;Create&amp;lt;/code&amp;gt; method allows for the instantiation of a new policy...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Policy Creation Documentation =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Policy&amp;lt;/code&amp;gt; class is designed to create and manage policies within the system. This documentation outlines the &amp;lt;code&amp;gt;Create&amp;lt;/code&amp;gt; method, detailing its purpose, usage, parameters, and return values. Policies are key components in systems requiring rules or guidelines that entities must follow.&lt;br /&gt;
&lt;br /&gt;
== Create Method ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Create&amp;lt;/code&amp;gt; method allows for the instantiation of a new policy with specified attributes, ensuring its unique presence within the system.&lt;br /&gt;
&lt;br /&gt;
=== Signature ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
public static Policy Create(string policyName, string description, Sprite icon = null)&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;policyName&amp;lt;/code&amp;gt; (string): The name of the policy, serving as a unique identifier.&lt;br /&gt;
* &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; (string): A brief overview of the policy, highlighting its purpose, application, and any important guidelines.&lt;br /&gt;
* &amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt; (Sprite, optional): A graphical representation of the policy, useful for user interfaces or visual identification.&lt;br /&gt;
&lt;br /&gt;
=== Returns ===&lt;br /&gt;
If a policy with the provided name already exists, the method returns the existing policy. If not, it creates, adds, and returns a new Policy object to the system.&lt;br /&gt;
&lt;br /&gt;
=== Example Usage ===&lt;br /&gt;
&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;
        CreateNewPolicy();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private void CreateNewPolicy() {&lt;br /&gt;
        Policy newPolicy = Policy.Create(&amp;quot;Economy&amp;quot;, &amp;quot;Description&amp;quot;, icon);&lt;br /&gt;
        &lt;br /&gt;
        IM.Player.Clan?.AddPolicy(newPolicy);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remarks ==&lt;br /&gt;
&lt;br /&gt;
* Uniqueness Check: Before creating a new policy, the method checks for the existence of a policy with the same name. This ensures each policy is unique within the system.&lt;br /&gt;
* Debug Logging: If a duplicate policy name is detected, a debug message is logged. This aids developers in identifying issues related to policy creation attempts.&lt;br /&gt;
* Policy Management: The addition of a new Policy object to the system facilitates the organization and management of policies. It ensures that policies are easily accessible and properly cataloged for reference and enforcement.&lt;br /&gt;
* Icon Usage: Including an icon with each policy can enhance user interaction by providing a visual cue. This is particularly useful in UI/UX design, where policies need to be represented visually.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>