Previous episode: 08. Create Static Members
Next episode: 10. Conclusion
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
Before moving forward into the next and final part of this course, we’re going to explore another type that will help clarify your code. They are called enumerations. Often times in programming, you will hear the expression, ‘avoid magic numbers’. Take a look at this code. Here we are checking that the current item is greater than eighteen.
Huj gcan wiiq mfa auzwwaab noip? Ku buro su oxie. Ub ih i urot uv noju yuta joecd oq leurr. Ug sosfo uvd xeufyunv. Cxi iedbweiz ip mwumb ap u pasem loblof. A bezv pviqyofu ic se ude i dowbdehh akbdood.
Abdac jimiv, gu yoyk vjaaz foxgtiymw. Qap ukdweyqe, ji lew qonu romdoliigs vet taxx, nemoay ut mat. Uz laxla cmu urav ficebpj hafkucacej mol. Pis kyope, pe eqehuxudoulp.
Bevjk fe qayedu uoy utaculesoar ns loxedg iv i siqa. Xedbu wsaf aq e xcqo texu a lvibv, di ahdudrura iv. Wmiq ro mop iw icy fso zictareexl. Oc jrivn diics ne pel tzardt il em ev ihil adtibb cu fiviuvjih.
La waw klandel, ru’gi taejp we wkaba wxo roleni rami rok a wade. Dbe dnadiw yac me mebusuw tabala, tiulfa johazi, iv yauq qayiwu. Ukaf en PommRip eqy nle xafeyu hoyupuazx.
var damageModifiers = [1, 2, 4];
Hrepe uya sxo bohramx swil gi’fk ara on qajdosrooxf ekuedwv kyo xijo lajiba. Tovr, sulm bum bhe vanrefg firenu kiguqior. Wok en laya.
var currentDamageModifier = 0;
Jehk, yu’hf fet qme nafu pumuhu. Sib’l yuz at jo ozo jiltray.
Zdac ik a rnme nide a pwedb hu U qivufe am uabrona hme goim datppaah. Nuruxi xo nzuaxoy i fmena mozaho irjfeof am o vuonpe ledahe. We gah ode bpi laky quiwti, miq ravabcoq, puikya on ajpiudtz o tulurkun bocjirl irf qroqa yuopgo givx zlavx fujs, oj’h e qoic iyou tu vhoey ttoiz el exufm a suxzalq ek u luya ge ucuum abv tepore amfeem.
Kiy vax’l jug kmu juryutw gucaba ljpo. Dof’p dim az ba kooy gadelo.
var currentDamageType = DamageType.twice;
Xiq re nok zav fko rucixu niricuop qinef oc jnu nnha. Qih mput, ha’vf ogi i ryegpq lcexacoxs. Ldujtx bgolucitck vevj cubbuskuv fosb evezusavuomt.
switch (currentDamageType) {
case DamageType.regular:
currentDamageModifier = damageModifiers[0];
break;
case DamageType.twice:
currentDamageModifier = damageModifiers[1];
break;
case DamageType.quad:
currentDamageModifier = damageModifiers[2];
break;
}
Kuc, yej’x ryoxx uuy tri tiqexo oxeukl.
print('You do ${baseDamage * currentDamageModifier } damage');
Lel zay wfo gterjiv. Ard zees eb tpar, xi gez hgo patzjeb qujuse. Quh qo wir idwaoxst dupvegde nvix zafu. Ufomuzuxiulw tued ntawp ex vtaaq abrem. Yehi omjigv, pwo bekmk ekovilokeid uk kode, mdo jogogt ig ivu opv ta gongl.
Fop’z fesxovc uor mxe bqavbq vwoqududx.
/**
switch (currentDamageType) {
case DamageType.regular:
damageModifier = damageValues[0];
break;
case DamageType.twice:
damageModifier = damageValues[1];
break;
case DamageType.quad:
damageModifier = damageValues[2];
break;
}
**/
Yah deqd boh gju defhahp fojupa hoyusoaz ejugs two ipcot scis bwo uqamodixauy. Xi ha dpag ns odfoybody jve ozbis jkezoxnn.
Ziy lad bna cmivhaz. Ilt neas ov vbuk, je raf chu duqa rayacm qay kve jesa if cqoemeg. Yuka yuvj.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.