void PGE_QuestionBox::update(float ticks) { switch(_page) { case 0: setFade(10, 1.0f, 0.05f); _page++; break; case 1: processLoader(ticks); break; case 2: processBox(ticks); break; case 3: processUnLoader(ticks); break; case 4: default: running=false; break; } }
/** * Parses box data * @param input input string with JSON description * @param box to fill in */ static void parseBoxData(const std::string& input, Box<double>& box) { JSONNode nd = libjson::parse(input); bool boxset = false; for (auto i = nd.begin(); i != nd.end(); i++) { if (i->name() == JsonNames::box) { processBox(*i, box); boxset = true; break; } } if (!boxset) BNB_ERROR_REPORT("Lattice data missing\n"); }
bool SVGReader::processSVG() { bool ok = true; if (!xml.isStartElement() || xml.name() != "svg") return false; QXmlStreamAttributes attr = xml.attributes(); for (auto a : attr) { if (a.name() == "x") xoffset = a.value().toInt(&ok, 10); if (a.name() == "y") yoffset = a.value().toInt(&ok, 10); if(!ok) return false; } xml.readNextStartElement(); switch(PolyEdit::hashit(xml.name().toString())) { case PolyEdit::Polygon: { return proccessPolygon(xml.attributes()); } case PolyEdit::Box: { return processBox(xml.attributes()); } case PolyEdit::Circle: { return processCircle(xml.attributes()); } case PolyEdit::Invalid: { return false; } } }
bool Parser::processObject() { std::string strType; if(!readBloqueTxt("type", strType)) return false; if(strType == "plane") { if(!processPlane()) return false; } else if(strType == "sphere") { if(!processSphere()) return false; } else if(strType == "cylinder") { if(!processCylinder()) return false; } else if(strType == "box") { if(!processBox()) return false; } else if(strType == "parallelogram") { if(!processParallelogram()) return false; } else if(strType == "triangle") { if(!processTriangle()) return false; } else if(strType == "mesh") { if(!processMesh()) return false; } else // Tipo de objeto desconocido. return false; return true; }