void InvertDirectionMessage::execute(Logic* logic){ std::vector<Entity*> entityVector = logic->getEntityVector(); for(unsigned int i = 0; i < entityVector.size(); i++){ Entity *currentEntity = entityVector[i]; if(currentEntity->getType() == GHOST){ Ghost *currentGhost = static_cast<Ghost*>(currentEntity); currentGhost->invertTravelDirection(); currentGhost->move(0, 1); } } }