2023-05-17 05:55:07 +00:00
import { _ as s , c as e , o as a , N as n } from "./chunks/framework.0799945b.js" ; const o = "/assets/persistence-error.537e237b.png" , u = JSON . parse ( '{"title":"Migrating to Profectus 0.6","description":"","frontmatter":{},"headers":[],"relativePath":"guide/migrations/0-6.md","lastUpdated":1684302845000}' ) , t = { name : "guide/migrations/0-6.md" } , l = n ( ` <h1 id="migrating-to-profectus-0-6" tabindex="-1">Migrating to Profectus 0.6 <a class="header-anchor" href="#migrating-to-profectus-0-6" aria-label="Permalink to "Migrating to Profectus 0.6""> </a></h1><p>Alongside the standard steps for <a href="./../getting-started/updating">Updating Profectus</a>, this update contains numerous large or breaking changes. This guide will cover additional steps to follow after updating Profectus.</p><h2 id="fixing-save-data" tabindex="-1">Fixing save data <a class="header-anchor" href="#fixing-save-data" aria-label="Permalink to "Fixing save data""> </a></h2><p>This update introduces a major change in save data collection and storage. The change reduces save data size and fixes issues that can cause persistent values to reset to default values. Unfortunately, developers will need to mark which persistent value uses should be included in the save data and which are merely references. Let's go through an example:</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#C792EA;">const</span><span style="color:#A6ACCD;"> flowers </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#82AAFF;">createResource</span><span style="color:#89DDFF;"><</span><span style="color:#FFCB6B;">DecimalSource</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">(</span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">moly</span><span style="color:#89DDFF;">"</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span>
2023-04-18 04:28:59 +00:00
< span class = "line" > < span style = "color:#C792EA;" > const < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > j o b < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > = < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > c r e a t e J o b < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( n a m e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < /span><span style="color:#676E95;font-style:italic;">/ * * snip * * / < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > r e s o u r c e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > f l o w e r s < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#89DDFF;" > } < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#676E95;font-style:italic;" > /** snip **/ < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#89DDFF;font-style:italic;" > return < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < /span><span style="color:#676E95;font-style:italic;">/ * * snip * * / < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > flowers < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > job < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#89DDFF;" > } < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > T h i s e x a m p l e s t o r e s t h e s a m e p e r s i s t e n t d a t a i n t w o l o c a t i o n s - < c o d e > f l o w e r s . f l o w e r s < / c o d e > a n d < c o d e > f l o w e r s . j o b . r e s o u r c e < / c o d e > . W e c a n m a r k t h e l a t t e r u s a g e a s a r e f e r e n c e b y w r a p p i n g i t i n t h e < a h r e f = " . / . . / . . / a p i / m o d u l e s / g a m e / p e r s i s t e n c e # n o p e r s i s t " > n o P e r s i s t < / a > u t i l i t y , s o i t & # 3 9 ; d l o o k l i k e < c o d e > r e s o u r c e : n o P e r s i s t ( f l o w e r s ) < / c o d e > . O t h e r w i s e , y o u w i l l e n c o u n t e r a n e r r o r i n t h e c o n s o l e w h e n t h e l a y e r i s l o a d e d : < / p > < p > < i m g s r c = " ` + o + ` " a l t = " P e r s i s t e n c e E r r o r " > < / p > < p > U s e t h e s e c o n s o l e e r r o r s t o i d e n t i f y s a v e d a t a r e d u n d a n c y t h a t n e e d s c o r r e c t i o n . I t i s r e c o m m e n d e d t o r u n t h e a p p a n d u s e t h e e r r o r s a s a g u i d e r a t h e r t h a n t r y i n g t o i d e n t i f y r e d u n d a n c i e s m a n u a l l y . < / p > < p > I n a d d i t i o n t o o b t a i n i n g n o n - p e r s i s t e n t r e f s f r o m y o u r p e r s i s t e n t r e f s , y o u m a y n e e d t o w r a p e n t i r e f e a t u r e s c o n t a i n i n g p e r s i s t e n t r e f s . F o r e x a m p l e , i n K r o n o s , t h e r e a r e s e v e n l a y e r s w i t h & q u o t ; J o b & q u o t ; f e a t u r e s , w h i c h a r e c o m b i n e d i n t o a d i c t i o n a r y i n t h e m a i n l a y e r . T h i s w o u l d c a u s e t h e p e r s i s t e n t s t a t e t o a p p e a r i n b o t h l a y e r s , b u t y o u c a n w r a p t h e d i c t i o n a r y i n a n o P e r s i s t c a l l t o b y p a s s s e r i a l i z a t i o n , e n s u r i n g i t o n l y u s e s t h e j o b s w i t h i n t h e i r r e s p e c t i v e l a y e r s . H e r e & # 3 9 ; s a n e x a m p l e f r o m K r o n o s : < / p > < d i v c l a s s = " l a n g u a g e - t s " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > t s < / s p a n > < p r e c l a s s = " s h i k i m a t e r i a l - t h e m e - p a l e n i g h t " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > c o n s t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > j o b s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > = < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > n o P e r s i s t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > f l o w e r s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > f l o w e r s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > j o b < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > d i s t i l l < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > d i s t i l l < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > j o b < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > s t u d y < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > s t u d y < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > j o b < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > e x p e r i m e n t s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > e x p e r i m e n t s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > j o b < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > g e n e r a t o r s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > g e n e r a t o r s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > j o b < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > b r e e d i n g < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > b r e e d i n g < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > j o b < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > r i t u a l s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > r i t u a l s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > j o b < / s p a n > < / s p a n >
2023-04-19 01:05:55 +00:00
< span class = "line" > < span style = "color:#89DDFF;" > } < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; f o n t - s t y l e : i t a l i c ; " > a s < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > R e c o r d < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > & l t ; < / s p a n > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > J o b K e y s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > G e n e r i c J o b < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > & g t ; ; < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > T h e t i m e r e q u i r e d f o r t h i s s t e p d e p e n d s o n y o u r p r o j e c t s t r u c t u r e . Y o u c a n u s e < a h r e f = " h t t p s : / / g i t h u b . c o m / t h e p a p e r p i l o t / K r o n o s / c o m m i t / 6 e 8 b f c 1 a 7 8 d f 0 a 7 9 5 7 d e 0 6 b a c d a b f 8 7 c 6 8 8 b 9 1 7 c " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > t h i s c o m m i t < / a > t o s e e a l l t h e c h a n g e s m a d e f o r K r o n o s , w h i c h u s e d a u t i l i t y f u n c t i o n f o r s i m i l a r f e a t u r e s t h a t l i m i t e d t h e n u m b e r o f r e q u i r e d c h a n g e s . < / p > < h 2 i d = " b r e a k i n g - f e a t u r e - c h a n g e s " t a b i n d e x = " - 1 " > B r e a k i n g f e a t u r e c h a n g e s < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # b r e a k i n g - f e a t u r e - c h a n g e s " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; B r e a k i n g f e a t u r e c h a n g e s & q u o t ; " > < / a > < / h 2 > < h 3 i d = " a c h i e v e m e n t s - a n d - m i l e s t o n e s " t a b i n d e x = " - 1 " > A c h i e v e m e n t s a n d M i l e s t o n e s < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # a c h i e v e m e n t s - a n d - m i l e s t o n e s " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; A c h i e v e m e n t s a n d M i l e s t o n e s & q u o t ; " > < / a > < / h 3 > < p > A c h i e v e m e n t s a n d m i l e s t o n e s h a v e b e e n m e r g e d . A n y e x i s t i n g a c h i e v e m e n t s s h o u l d n o w h a v e t h e < c o d e > s m a l l : t r u e < / c o d e > p r o p e r t y s e t t o k e e p t h e s a m e d i s p l a y a s b e f o r e . M i l e s t o n e s s h o u l d n o w u s e t h e < c o d e > c r e a t e A c h i e v e m e n t < / c o d e > c o n s t r u c t o r i n s t e a d o f < c o d e > c r e a t e M i l e s t o n e < / c o d e > , a n d t h e y w i l l a p p e a r a n d b e h a v e a s b e f o r e . < / p > < h 3 i d = " b u y a b l e s " t a b i n d e x = " - 1 " > B u y a b l e s < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # b u y a b l e s " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; B u y a b l e s & q u o t ; " > < / a > < / h 3 > < p > B u y a b l e s h a v e b e e n r e n a m e d t o & q u o t ; r e p e a t a b l e s & q u o t ; . T o u p d a t e y o u r c o d e , y o u & # 3 9 ; l l n e e d t o r e p l a c e a l l r e f e r e n c e s t o b u y a b l e w i t h r e p e a t a b l e . A d d i t i o n a l l y , v a r i o u s p r o p e r t i e s h a v e b e e n r e m o v e d o r c h a n g e d t o n o l o n g e r r e f e r t o p u r c h a s e s : < / p > < u l > < l i > < c o d e > c a n A f f o r d < / c o d e > n o l o n g e r e x i s t s , a n d y o u s h o u l d i n s t e a d a d d c o n d i t i o n s v i a t h e r e q u i r e m e n t s s y s t e m < / l i > < l i > < c o d e > o n P u r c h a s e < / c o d e > s h o u l d b e c o m e < c o d e > o n C l i c k < / c o d e > < / l i > < l i > < c o d e > p u r c h a s e ( ) < / c o d e > s h o u l d b e c o m e < c o d e > c l i c k ( ) < / c o d e > < / l i > < / u l > < h 3 i d = " r e q u i r e m e n t s " t a b i n d e x = " - 1 " > R e q u i r e m e n t s < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # r e q u i r e m e n t s " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; R e q u i r e m e n t s & q u o t ; " > < / a > < / h 3 > < p > M a n y f e a t u r e s n o w u s e < c o d e > r e q u i r e m e n t s < / c o d e > p r o p e r t i e s w h e r e b e f o r e t h e y w o u l d h a v e a c o s t o r o t h e r c o n d i t i o n . T h e < c o d e > r e q u i r e m e n t s < / c o d e > p r o p e r t y t a k e s a s i n g l e < c o d e > R e q u i r e m e n t < / c o d e > o b j e c t o r a n a r r a y o f t h e m . R e q u i r e m e n t s m a k e i t e a s i e r t o s u p p o r t f e a t u r e s r e q u i r i n g m u l t i p l e c u r r e n c i e s o r o t h e r c o n d i t i o n s . < / p > < p > W h e n c o u p l e d w i t h t h e f o r m u l a s s y s t e m , t h e y a l s o a l l o w f o r s c a l i n g r e q u i r e m e n t s t h a t c a n b e c a l c u l a t e d e f f i c i e n t l y . H e r e i s a n e x a m p l e r e p e a t a b l e t h a t s t a r t s b y c o s t i n g 1 0 0 p o i n t s a n d g e t s 1 . 0 5 x m o r e e x p e n s i v e w i t h e a c h p u r c h a s e , c o m p o u n d i n g . T h a n k s t o f o r m u l a s t h e r e p e a t a b l e w i l l b e a b l e t o i m m e d i a t e l y i n c r e a s e a s m a n y l e v e l s a s t h e p l a y e r c a n a f f o r d a t o n c e : < / p > < d i v c l a s s = " l a n g u a g e - t s " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > t s < / s p a n > < p r e c l a s s = " s h i k i m a t e r i a l - t h e m e - p a l e n i g h t " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > c o n s t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > m y R e p e a t a b l e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > = < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > c r e a t e R e p e a t a b l e < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > r e q u i r e m e n t s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > c r e a t e C o s t R e q u i r e m e n t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > r e s o u r c e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > p o i n t s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
2023-04-23 17:48:42 +00:00
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > c o s t < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > F o r m u l a < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > v a r i a b l e < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( m y R e p e a t a b l e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > a m o u n t ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > p o w _ b a s e < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 1 . 0 5 < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > t i m e s < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 1 0 0 < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) < / s p a n > < / s p a n >
2023-04-19 01:05:55 +00:00
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > } < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > m a x i m i z e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # F F 9 C A C ; " > t r u e < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#89DDFF;" > } < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ; < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > T o u p d a t e a n e x i s t i n g n o n - s c a l i n g c o s t r e q u i r e m e n t , w r a p y o u r c u r r e n t c o s t f u n c t i o n a n d r e s o u r c e p r o p e r t y a s f o l l o w s : < / p > < d i v c l a s s = " l a n g u a g e - t s " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > t s < / s p a n > < p r e c l a s s = " s h i k i m a t e r i a l - t h e m e - p a l e n i g h t " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > c o n s t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > u p g r a d e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > = < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > c r e a t e U p g r a d e < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > r e q u i r e m e n t s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > c r e a t e C o s t R e q u i r e m e n t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > c o s t < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > D e c i m a l < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > p o w < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( p r i c e R a t i o < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > u n r e f < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( m a c h i n e s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > a m o u n t ) ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > r e s o u r c e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > g e n e r a t o r s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > e n e r g e i a < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > } < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#89DDFF;" > } < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ; < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > F o r o t h e r c o n d i t i o n s , y o u c a n u s e t h e < c o d e > c r e a t e B o o l e a n R e q u i r e m e n t < / c o d e > c o n s t r u c t o r i n s t e a d : < / p > < d i v c l a s s = " l a n g u a g e - t s " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > t s < / s p a n > < p r e c l a s s = " s h i k i m a t e r i a l - t h e m e - p a l e n i g h t " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > c o n s t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > s p e l l E x p M i l e s t o n e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > = < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > c r e a t e A c h i e v e m e n t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > r e q u i r e m e n t s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > c r e a t e B o o l e a n R e q u i r e m e n t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > D e c i m a l < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > g t e < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( j o b < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > r a w L e v e l < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > v a l u e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 2 < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#89DDFF;" > } < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ; < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > L e a r n m o r e a b o u t r e q u i r e m e n t s a n d t h e i r c a p a b i l i t i e s i n < a h r e f = " . / . . / i m p o r t a n t - c o n c e p t s / r e q u i r e m e n t s " > t h i s g u i d e p a g e < / a > . < / p > < h 3 i d = " f o r m u l a s " t a b i n d e x = " - 1 " > F o r m u l a s < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f o r m u l a s " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; F o r m u l a s & q u o t ; " > < / a > < / h 3 > < p > F o r m u l a s a r e a n e w f e a t u r e t h a t a l l o w s f o r s c a l i n g c o s t o r e f f e c t f u n c t i o n s t o b e i n v e r t e d o r i n t e g r a t e d w i t h o u t r e q u i r i n g t h e d e v e l o p e r t o c o d e a n y t h i n g b e y o n d t h e o r i g i n a l f o r m u l a . T h e y c a n s i m p l i f y s u p p o r t f o r & q u o t ; b u y m a x & q u o t ; f u n c t i o n a l i t i e s a n d m a k e c o n v e r s i o n s e a s i e r t o r e a d a n d w r i t e . < / p > < p > A n y c o s t r e q u i r e m e n t s c a n n o w a c c e p t a f o r m u l a i n s t e a d o f a c o s t f u n c t i o n . T h e f o r m u l a s y s t e m c a n t h e n h a n d l e d e t e r m i n i n g h o w m a n y p u r c h a s e s c a n b e m a d e a t o n c e . T o c o n t i n u e t h e e x a m p l e a b o v e , h e r e & # 3 9 ; s h o w i t w o u l d b e r e w r i t t e n : < / p > < d i v c l a s s = " l a n g u a g e - t s " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > t s < / s p a n > < p r e c l a s s = " s h i k i m a t e r i a l - t h e m e - p a l e n i g h t " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > r e q u i r e m e n t s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > c r e a t e C o s t R e q u i r e m e n t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > { < / s p a n > < / s p a n >
2023-04-18 04:28:59 +00:00
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > c o s t < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > F o r m u l a < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > v a r i a b l e < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( m a c h i n e s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > a m o u n t ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > p o w _ b a s e < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( p r i c e R a t i o ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#A6ACCD;" > < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > r e s o u r c e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > g e n e r a t o r s < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > e n e r g e i a < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < / s p a n >
2023-04-20 03:20:38 +00:00
< span class = "line" > < span style = "color:#89DDFF;" > } < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > C o n v e r s i o n s w o r k a b i t d i f f e r e n t l y . T h e i r s c a l i n g f u n c t i o n s y s t e m h a s b e e n r e p l a c e d w i t h a < c o d e > f o r m u l a < / c o d e > p r o p e r t y t h a t t a k e s a l a m b d a - i t p r o v i d e s t h e i n p u t f o r m u l a v a r i a b l e , r e p r e s e n t i n g t h e b a s e r e s o u r c e , a s a p a r a m e t e r , a n d y o u r e t u r n a f o r m u l a r e p r e s e n t i n g t h e a m o u n t o f t h e g a i n r e s o u r c e t h a t c o u l d b e c o n v e r t e d . F o r e x a m p l e , i f y o u p r e v i o u s l y h a d c o d e l i k e t h i s : < / p > < d i v c l a s s = " l a n g u a g e - t s " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > t s < / s p a n > < p r e c l a s s = " s h i k i m a t e r i a l - t h e m e - p a l e n i g h t " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > s c a l i n g < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > a d d S o f t c a p < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > c r e a t e P o l y n o m i a l S c a l i n g < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 1 0 < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 0 . 5 < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 1 e 1 0 0 < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 0 . 5 < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > y o u c a n n o w w r i t e t h i s : < / p > < d i v c l a s s = " l a n g u a g e - t s " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > t s < / s p a n > < p r e c l a s s = " s h i k i m a t e r i a l - t h e m e - p a l e n i g h t " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > f o r m u l a < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; f o n t - s t y l e : i t a l i c ; " > x < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > x < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > d i v < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 1 0 < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > s q r t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > s t e p < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # F 7 8 C 6 C ; " > 1 e 1 0 0 < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > , < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; f o n t - s t y l e : i t a l i c ; " > f < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # C 7 9 2 E A ; " > = & g t ; < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > f < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > s q r t < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > ( ) ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > L e a r n m o r e a b o u t f o r m u l a s a n d t h e i r c a p a b i l i t i e s i n < a h r e f = " . / . . / i m p o r t a n t - c o n c e p t s / f o r m u l a s " > t h i s g u i d e p a g e < / a > . < / p > < h 3 i d = " m o d i f i e r s " t a b i n d e x = " - 1 " > M o d i f i e r s < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # m o d i f i e r s " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; M o d i f i e r s & q u o t ; " > < / a > < / h 3 > < p > M o d i f i e r s n o w d i s p l a y n e g a t i v e e f f e c t s i n r e d . T h e c u r r e n t i m p l e m e n t a t i o n a s s u m e s a n y v a l u e t h a t r e d u c e s t h e r e s u l t i s n e g a t i v e , a n d t h e o u t p u t b e i n g l e s s t h a n t h e b a s e v a l u e i s a n e g a t i v e o u t c o m e . H o w e v e r , f o r s o m e m o d i f i e r s , t h i s m a y b e t h e o p p o s i t e o f w h a t y o u w a n t - f o r e x a m p l e , a c o o l d o w n b e i n g r e d u c e d b e l o w i t s b a s e v a l u e i s a p o s i t i v e e f f e c t . F o r t h o s e m o d i f i e r s , s e t t h e < c o d e > s m a l l e r I s B e t t e r < / c o d e > p r o p e r t y t o < c o d e > t r u e < / c o d e > . T h i s p r o p e r t y a l s o e x i s t s w h e n c r e a t i n g c o l l a p s i b l e m o d i f i e r s e c t i o n s . < / p > < p > M o d i f i e r s h a v e r e n a m e d t h e i r < c o d e > r e v e r t < / c o d e > p r o p e r t y t o < c o d e > i n v e r t < / c o d e > t o m a t c h t h e t e r m s u s e d b y f o r m u l a s . U p d a t e a n y c u s t o m m o d i f i e r s y o u & # 3 9 ; v e c r e a t e d a c c o r d i n g l y . < / p > < h 3 i d = " c u s t o m - f e a t u r e s " t a b i n d e x = " - 1 " > C u s t o m F e a t u r e s < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # c u s t o m - f e a t u r e s " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; C u s t o m F e a t u r e s & q u o t ; " > < / a > < / h 3 > < p > L a z y p r o x i e s n o w c a l l t h e o p t i o n s f u n c t i o n w i t h t h e b a s e o b j e c t a s t h e < c o d e > t h i s < / c o d e > a r g u m e n t a n d t h e f i r s t p a r a m e t e r . F e a t u r e s w i t h < c o d e > o p t i o n s < / c o d e > f u n c t i o n s a r e
2023-04-18 04:28:59 +00:00
< span class = "line" > < span style = "color:#F07178;" > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; f o n t - s t y l e : i t a l i c ; " > r e t u r n < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 8 2 A A F F ; " > s h o w I f < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > ( < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > s p e l l E x p M i l e s t o n e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > e a r n e d < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > v a l u e < / s p a n > < s p a n s t y l e = " c o l o r : # F 0 7 1 7 8 ; " > ) < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > ; < / s p a n > < / s p a n >
2023-04-20 03:20:38 +00:00
< span class = "line" > < span style = "color:#89DDFF;" > } < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > T h i s c o d e c a n n o w b e s i m p l i f i e d t o : < / p > < d i v c l a s s = " l a n g u a g e - t s " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > t s < / s p a n > < p r e c l a s s = " s h i k i m a t e r i a l - t h e m e - p a l e n i g h t " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " c o l o r : # F F C B 6 B ; " > v i s i b i l i t y < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > : < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > s p e l l E x p M i l e s t o n e < / s p a n > < s p a n s t y l e = " c o l o r : # 8 9 D D F F ; " > . < / s p a n > < s p a n s t y l e = " c o l o r : # A 6 A C C D ; " > e a r n e d < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > B e a w a r e t h a t u s i n g t h e c o m p u t e d r e f d i r e c t l y i n s t e a d o f a f u n c t i o n c a n c a u s e c i r c u l a r d e p e n d e n c y i s s u e s . I f y o u e n c o u n t e r o n e w h i l e s i m p l i f y i n g a v i s i b i l i t y p r o p e r t y , r e s o l v e t h e i s s u e o r c o n t i n u e u s i n g a f u n c t i o n , r e t u r n i n g t h e c o m p u t e d r e f v a l u e . < / p > < h 3 i d = " c u s t o m - c o m p o n e n t s " t a b i n d e x = " - 1 " > C u s t o m C o m p o n e n t s < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # c u s t o m - c o m p o n e n t s " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; C u s t o m C o m p o n e n t s & q u o t ; " > < / a > < / h 3 > < p > I f y o u c r e a t e d a n y c u s t o m f e a t u r e s w i t h t h e i r o w n V u e c o m p o n e n t s , y o u & # 3 9 ; l l n e e d t o u p d a t e t h e m t o s u p p o r t b o o l e a n s f o r v i s i b i l i t y v a l u e s . T h i s m e a n s r e p l a c i n g < s t r o n g > A L L < / s t r o n g > e q u a l i t y c h e c k s f o r s p e c i f i c v i s i b i l i t i e s w i t h c a l l s t o < a h r e f = " . / . . / . . / a p i / m o d u l e s / f e a t u r e s / f e a t u r e # i s v i s i b l e " > i s V i s i b l e < / a > a n d < a h r e f = " . / . . / . . / a p i / m o d u l e s / f e a t u r e s / f e a t u r e # i s h i d d e n " > i s H i d d e n < / a > . < / p > < p > W h i l e u p d a t i n g y o u r c o m p o n e n t , y o u m a y n e e d t o c a s t t h e c o m p o n e n t t o < a h r e f = " . / . . / . . / a p i / m o d u l e s / f e a t u r e s / f e a t u r e # g e n e r i c c o m p o n e n t " > G e n e r i c C o m p o n e n t < / a > . < / p > ` , 5 2 ) , p = [ l ] ; f u n c t i o n r ( c , i , y , D , d , A ) { r e t u r n a ( ) , e ( " d i v " , n u l l , p ) } c o n s t F = s ( t , [ [ " r e n d e r " , r ] ] ) ; e x p o r t { u a s _ _ p a g e D a t a , F a s d e f a u l t } ;