<?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=Family%3ACreate</id>
	<title>Family: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=Family%3ACreate"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=Family:Create&amp;action=history"/>
	<updated>2026-05-12T22:17:41Z</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=Family:Create&amp;diff=1204&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;= Family Creation =  == Overview == The &lt;code&gt;Family&lt;/code&gt; class provides methods to create and manage families with specific attributes. This documentation explains how to use the &lt;code&gt;Create&lt;/code&gt; method, detailing its parameters, return types, and providing example implementations for creating families.  == Create Method Variants == The &lt;code&gt;Create&lt;/code&gt; method has two variants, each designed to accommodate different scenarios for specifying family attributes, su...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=Family:Create&amp;diff=1204&amp;oldid=prev"/>
		<updated>2024-03-03T11:35:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Family Creation =  == Overview == The &amp;lt;code&amp;gt;Family&amp;lt;/code&amp;gt; class provides methods to create and manage families with specific attributes. This documentation explains how to use the &amp;lt;code&amp;gt;Create&amp;lt;/code&amp;gt; method, detailing its parameters, return types, and providing example implementations for creating families.  == Create Method Variants == The &amp;lt;code&amp;gt;Create&amp;lt;/code&amp;gt; method has two variants, each designed to accommodate different scenarios for specifying family attributes, su...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Family Creation =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Family&amp;lt;/code&amp;gt; class provides methods to create and manage families with specific attributes. This documentation explains how to use the &amp;lt;code&amp;gt;Create&amp;lt;/code&amp;gt; method, detailing its parameters, return types, and providing example implementations for creating families.&lt;br /&gt;
&lt;br /&gt;
== Create Method Variants ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Create&amp;lt;/code&amp;gt; method has two variants, each designed to accommodate different scenarios for specifying family attributes, such as culture.&lt;br /&gt;
&lt;br /&gt;
=== Variant 1: Create with Direct Object References ===&lt;br /&gt;
&lt;br /&gt;
==== Description ====&lt;br /&gt;
Creates a new family with specific attributes using direct object references for the culture. It is the preferred method when you have a direct reference to the culture object.&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 Family Create(string familyName, string description, Culture culture = null, 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;familyName&amp;lt;/code&amp;gt; (string): The name of the family.&lt;br /&gt;
* &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; (string): A description of the family's history, values, or notable characteristics.&lt;br /&gt;
* &amp;lt;code&amp;gt;culture&amp;lt;/code&amp;gt; (Culture, optional): The culture associated with the family.&lt;br /&gt;
* &amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt; (Sprite, optional): A visual representation (banner) of the family.&lt;br /&gt;
&lt;br /&gt;
==== Returns ====&lt;br /&gt;
If a family with the same name exists, it returns the existing family; otherwise, it creates and returns a new family.&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;
&lt;br /&gt;
    public Sprite icon;&lt;br /&gt;
&lt;br /&gt;
    private void Start() {&lt;br /&gt;
        CreatePlayerFamily();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void CreatePlayerFamily() {&lt;br /&gt;
        Family family = Family.Create(&amp;quot;Frostborn&amp;quot;, &amp;quot;Description&amp;quot;, IM.Player.Culture, icon);&lt;br /&gt;
        &lt;br /&gt;
        IM.Player.JoinFamily(family);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Variant 2: Create with Culture by Name or ID ===&lt;br /&gt;
&lt;br /&gt;
==== Description ====&lt;br /&gt;
Facilitates family creation using the name or ID for culture instead of a direct object reference. This method is useful when you prefer to reference culture by an identifier.&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 Family Create(string familyName, string description, string cultureNameOrId, Sprite icon)&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;familyName&amp;lt;/code&amp;gt; (string): The name of the family.&lt;br /&gt;
* &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; (string): A description of the family's history, values, or notable characteristics.&lt;br /&gt;
* &amp;lt;code&amp;gt;cultureNameOrId&amp;lt;/code&amp;gt; (string): The name or ID of the culture associated with the family.&lt;br /&gt;
* &amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt; (Sprite): A visual representation (banner) of the family.&lt;br /&gt;
&lt;br /&gt;
==== Returns ====&lt;br /&gt;
If a family with the same name exists, it returns the existing family; otherwise, it creates and returns a new family.&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;
&lt;br /&gt;
    public Sprite icon;&lt;br /&gt;
&lt;br /&gt;
    private void Start() {&lt;br /&gt;
        CreatePlayerFamily();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void CreatePlayerFamily() {&lt;br /&gt;
        Family family = Family.Create(&amp;quot;Frostborn&amp;quot;, &amp;quot;Description&amp;quot;, &amp;quot;Varag&amp;quot;, icon);&lt;br /&gt;
        &lt;br /&gt;
        IM.Player.JoinFamily(family);&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: Both method variants check for the existence of a family with the provided name to ensure uniqueness. If an existing family is found, it returns the existing family to prevent duplication.&lt;br /&gt;
* Debug Logging: A debug message is logged if an attempt is made to create a family with a name that already exists within the system. This aids in debugging and maintaining the integrity of the family system.&lt;br /&gt;
* Culture Validation: For the second variant, where culture is specified by name or ID, the method includes validation to ensure the specified culture exists within the system before creating the family.&lt;br /&gt;
* Error Handling: Implementing error handling around the &amp;lt;code&amp;gt;Create&amp;lt;/code&amp;gt; method is recommended, especially for the second variant, to deal with scenarios where the specified culture does not exist.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>