void Fruit::Load(tinyxml2::XMLElement const& element) { char const* sprite = element.Attribute("Sprite"); assert(sprite); m_Sprite.Load(sprite); m_Sprite.SetOriginToCentre(); m_Score = element.IntAttribute("Score"); m_Appear1 = element.IntAttribute("Appear1"); m_Appear2 = element.IntAttribute("Appear2"); m_Time = element.FloatAttribute("Time"); }
void Restaurant::decodeXML(tinyxml2::XMLElement & xml) { Item::decodeXML(xml); variant = xml.IntAttribute("variant"); open = xml.BoolAttribute("open"); updateSprite(); }
void Elevator::decodeXML(tinyxml2::XMLElement & xml) { clearCars(); Item::decodeXML(xml); size.y = xml.IntAttribute("height"); for (tinyxml2::XMLElement * e = xml.FirstChildElement("unserviced"); e; e = e->NextSiblingElement("unserviced")) { unservicedFloors.insert(e->IntAttribute("floor")); } for (tinyxml2::XMLElement * e = xml.FirstChildElement("car"); e; e = e->NextSiblingElement("car")) { Car * car = new Car(this); car->decodeXML(*e); cars.insert(car); } updateSprite(); }