{"id":2346,"date":"2025-11-16T18:38:54","date_gmt":"2025-11-16T18:38:54","guid":{"rendered":"https:\/\/golemitegames.com\/?post_type=docs&#038;p=2346"},"modified":"2025-11-21T20:40:59","modified_gmt":"2025-11-21T20:40:59","password":"","slug":"item-amount","status":"publish","type":"docs","link":"https:\/\/golemitegames.com\/index.php\/docs\/item-amount\/","title":{"rendered":"Item Amount"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" style=\"font-size:22px;text-transform:capitalize\">Introduction<\/h2>\n\n\n\n<p>A simple class that stores an <a href=\"https:\/\/golemitegames.com\/index.php\/docs\/item\/\" title=\"Item\">Item<\/a>, and an Amount. <br><br>This class also Clamps and Rounds depending on the <a href=\"https:\/\/golemitegames.com\/index.php\/docs\/item\/\" title=\"Item\">Item&#8217;s<\/a> Precision Type setting.<br><br>Item Amounts have a custom property drawer which look like the below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"722\" height=\"62\" src=\"https:\/\/golemitegames.com\/wp-content\/uploads\/2025\/11\/image-30.png\" alt=\"\" class=\"wp-image-2348\" style=\"width:400px\" srcset=\"https:\/\/golemitegames.com\/wp-content\/uploads\/2025\/11\/image-30.png 722w, https:\/\/golemitegames.com\/wp-content\/uploads\/2025\/11\/image-30-300x26.png 300w\" sizes=\"(max-width: 722px) 100vw, 722px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" style=\"font-size:22px;text-transform:capitalize\">Setting up<\/h2>\n\n\n\n<p>There is no setup, all Item Amounts are handled internally or through other parts of code such as the <a href=\"https:\/\/golemitegames.com\/index.php\/docs\/resource\/\" title=\"Resource\">Resource<\/a> class. However you can see what they look like by adding one on an <a href=\"https:\/\/golemitegames.com\/index.php\/docs\/item-container\/\" title=\"Item Container\">Item Container<\/a> in the Item Amounts list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" style=\"font-size:22px;text-transform:capitalize\">Scripting<\/h2>\n\n\n\n<p>To understand and use this class in your own scripts, you can see below from the script. <\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\" data-show-lang=\"0\"><code>\/\/\/ &lt;summary&gt;\n\/\/\/ Get the ItemAmount.Amount which includes Floor for Item.Integer precision type, or RoundToPrecision for Item.Float precision type\n\/\/\/ &lt;\/summary&gt;\npublic double Amount\n\n\/\/\/ &lt;summary&gt;\n\/\/\/ Create a new ItemAmount with an Item and an Amount\n\/\/\/ &lt;\/summary&gt;\n\/\/\/ &lt;param name=&quot;item&quot;&gt;The Item to assign to this ItemAmount&lt;\/param&gt;\n\/\/\/ &lt;param name=&quot;amount&quot;&gt;The Amount of this Item&lt;\/param&gt;\npublic ItemAmount(Item item, double amount)\n\n\/\/\/ &lt;summary&gt;\n\/\/\/ Creates a new copy of ItemAmount with a given ItemAmount \n\/\/\/ &lt;\/summary&gt;\n\/\/\/ &lt;param name=&quot;itemAmount&quot;&gt;The ItemAmount to copy&lt;\/param&gt;\npublic ItemAmount(ItemAmount itemAmount)<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction A simple class that stores an Item, and an Amount. This class also Clamps and Rounds depending on the Item&#8217;s Precision Type setting. Item Amounts have a custom property drawer which look like the below. Setting up There is no setup, all Item Amounts are handled internally or through other parts of code such [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"doc_category":[46],"doc_tag":[],"class_list":["post-2346","docs","type-docs","status-publish","hentry","doc_category-resource-and-production"],"acf":[],"aioseo_notices":[],"year_month":"2026-04","word_count":213,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"rickitz5h","author_nicename":"rickitz5h","author_url":"https:\/\/golemitegames.com\/index.php\/author\/rickitz5h\/"},"doc_category_info":[{"term_name":"Resource And Production","term_url":"https:\/\/golemitegames.com\/index.php\/docs-category\/resource-and-production\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/docs\/2346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/comments?post=2346"}],"version-history":[{"count":3,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/docs\/2346\/revisions"}],"predecessor-version":[{"id":2545,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/docs\/2346\/revisions\/2545"}],"wp:attachment":[{"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/media?parent=2346"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/doc_category?post=2346"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/doc_tag?post=2346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}