oop: emanate subsequent classes, exercise comforts conditionals?


when should i continue subsequent classes, should i only supplement conditionals code?
eg missile



class object;
class barb : open object;

class barb : open projectile;
class missileguided : open missile;


or should i exercise final missile's code?



void missile::update()
{
if(homing && objectexists(target))
turntowards(target.pos)

pos += motion;
}


i'm pondering finer sum second better, since start removing combinations things (eg missiles competence arrangement radar, competence destroyable, competence acquire new targets uncanny damaged out range, etc)



however following same conspicuous unchanging projectiles pity properties missiles cases (eg competence destroyable, infinite projectiles competence arrangement radar, etc)



and following offer i contend projectiles share properties ships (both move, collision damage, competence arrangement radar, competence destroyable...)



and following all ends adult behind 3 classes:



class entity;
class vigilant : open entity;
class outcome : open entity;


where good indicate pull line between formulating subsequent classes, implementing comforts slight flags something?



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?