|
You last visited: Today at 17:04
Advertisement
I still can't figure it out >.<
Discussion on I still can't figure it out >.< within the CO2 Programming forum part of the Conquer Online 2 category.
05/14/2012, 19:31
|
#16
|
elite*gold: 20
Join Date: Mar 2006
Posts: 1,491
Received Thanks: 536
|
Quote:
Originally Posted by IAmHawtness
If you're talking about a "IsValidMonster" property on the Entity class, I highly disagree. Why would that logic belong to the Entity class? It has absolutely no place there IMO.
Sorry if I misunderstood you
|
He's just saying to not check for false, but to check for true instead. Problem with checking for false is that anything not true will be considered false. For example, if there were 3 types of items being checked, player, npc, mob, checking if it's not a player will return true for mobs (what you want) and npcs (what you still don't want) while checking if it's a mob will return only true on mobs, and false on players and npcs. It's more of being precise in what you want. That is, if I'm correct on what I'm assuming he means.
|
|
|
05/14/2012, 19:39
|
#17
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
Quote:
Originally Posted by IAmHawtness
If you're talking about a "IsValidMonster" property on the Entity class, I highly disagree. Why would that logic belong to the Entity class? It has absolutely no place there IMO.
Sorry if I misunderstood you
|
Sorry, I was referring to negative logic in general rather than this actual code snippet.
!condition1 and !condition2 and !condition3 type statements are not exactly good form and can really serve to confuse you when looking for issues.
<edit> Yes, exactly what bone is saying but also from a coding style standpoint.
When running conditions you should be checking for what you DO want rather then ruling out everything you DON'T want. When you write all your checks limiting out what you don't want, your code is difficult to skim through and, more seriously, is no longer very expandable as you need to go back and add more negative conditions for every new possibility you add.
|
|
|
05/14/2012, 20:26
|
#18
|
elite*gold: 20
Join Date: Aug 2007
Posts: 1,749
Received Thanks: 2,199
|
Quote:
Originally Posted by bone-you
He's just saying to not check for false, but to check for true instead. Problem with checking for false is that anything not true will be considered false. For example, if there were 3 types of items being checked, player, npc, mob, checking if it's not a player will return true for mobs (what you want) and npcs (what you still don't want) while checking if it's a mob will return only true on mobs, and false on players and npcs. It's more of being precise in what you want. That is, if I'm correct on what I'm assuming he means.
|
Quote:
Originally Posted by pro4never
Sorry, I was referring to negative logic in general rather than this actual code snippet.
!condition1 and !condition2 and !condition3 type statements are not exactly good form and can really serve to confuse you when looking for issues.
<edit> Yes, exactly what bone is saying but also from a coding style standpoint.
When running conditions you should be checking for what you DO want rather then ruling out everything you DON'T want. When you write all your checks limiting out what you don't want, your code is difficult to skim through and, more seriously, is no longer very expandable as you need to go back and add more negative conditions for every new possibility you add.
|
Oh, makes sense now, didn't catch that part  . I generally try to avoid the "if not" statements, but I feel that sometimes it's just easier to code and makes more sense using the not operator
|
|
|
 |
|
Similar Threads
|
Help me to figure it out please !!!??
03/16/2011 - Aion - 3 Replies
How can a gladiator use shield defense + slaughter "bug" , please if any 1 know it tell me or pm in the forum.
here is a video that guy's using it :
YouTube - Aion Gladiator Level 55 Dual Wielding Duels
Please as soon as possible ..
Thanks .
|
Please Help me i can't figure this out :s
09/30/2010 - Silkroad Online - 3 Replies
Hello everyone ,
Please i can't play silkroad on my new laptop , when i lunch silkroad.exe nothing happens for like 30 sec then this message pops up :
http://img833.imageshack.us/img833/5170/errory.pn g
Please help me :s , Sbot doesn't work either , when i press Login the little message appears but it doesn't progress , like if it couldn't connect to the bot server , then a message apears in the bot in red : " Error- failed to connect"
I have Windows 7 on my laptop if that could help.
|
Anybody figure out . . .
03/18/2010 - Archlord - 9 Replies
How to trade unique accessories now, even though they are "bound". Just wondering if it is possible.
|
could someone figure this out?
12/05/2009 - Grand Chase - 5 Replies
YouTube - EXP Hack in progress
this guy seemse to be doing a exp hack and monster lvl hack....
could someone please tell me how to do this?
|
Let's figure out the +1s
06/18/2006 - Conquer Online 2 - 28 Replies
From here on out, everyone please post any statistics they can on +1 drops. This includes item type, dura, sockets, lvl, quality, blessed, etc. Also post the times, we're going to bust down this +1 non-sense.
Thanks for your help,
-einhornchen
|
All times are GMT +1. The time now is 17:06.
|
|