C++ Multiple Condition Statements - Merging
<p>I have written a program according to a specification.<br>
The Specification has about 3 types and each type gets handled differently on every single point.</p>

<p>That means more or less for code readability, I have written it like shown below, now my question is, if you have <strong>200</strong> such <strong>statements</strong>, wouldn't it be worth to merge them all into one "if enum-type x"</p>

<p>I would believe there is a program out there which already does it but google didn't help me much for this specific problem. Thanks for help in advance.</p>

<pre><code>/* Point 1.15 Filling Customers bdate */

if(current.identifier == APPLE){ output.setValue(1.15, additionalObj.some.color)}
if(current.identifier == PLUM){ output.setValue(1.15, otherObj.another.color) }
if(current.identifier == GRAPE){ output.setValue(1.15, default::color) }


/* Point 1.16 Filling Customers cash*/

if(current.identifier == APPLE){ do whatever}
if(current.identifier == PLUM){ do whatever}
if(current.identifier == GRAPE){ do whatever}
</code></pre>

<p>Result to be achieved:</p>

<pre><code>if(current.identifier == APPLE){ output.setValue(1.15, additionalObj.some.color) 
                                 do whatever
}
</code></pre>

<p>And so on so i can merge them into 1 statement automatically while i still have the readable code</p>

<p>Edit: I might have misinformed you, its actually not a type its just an Object with a String identifier and SubObjects so i can't use polymorphism. I have adjusted the above so you can see what i would like to achieve.</p>
