1 line
12 KiB
JSON

{"sections":[],"hierarchy":{"paths":[["doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator"]]},"identifier":{"url":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food","interfaceLanguage":"swift"},"kind":"symbol","metadata":{"modules":[{"name":"SlothCreator"}],"externalID":"s:12SlothCreator0A0V4FoodV","role":"symbol","title":"Sloth.Food","extendedModule":"SlothCreator","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Food","kind":"identifier"}],"navigatorTitle":[{"text":"Food","kind":"identifier"}],"symbolKind":"struct","roleHeading":"Structure"},"topicSections":[{"identifiers":["doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/init(name:energy:)"],"title":"Creating a Food Item","anchor":"Creating-a-Food-Item"},{"title":"Getting the Food Details","identifiers":["doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/name","doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/energy"],"anchor":"Getting-the-Food-Details"},{"title":"Getting the Default Foods","anchor":"Getting-the-Default-Foods","identifiers":["doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/largeLeaf","doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/regularLeaf","doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/twig"]}],"seeAlsoSections":[{"identifiers":["doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Activity","doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/CareSchedule","doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/FoodGenerator"],"generated":true,"anchor":"Care-and-Feeding","title":"Care and Feeding"}],"abstract":[{"type":"text","text":"Food that a sloth can consume."}],"schemaVersion":{"minor":3,"major":0,"patch":0},"primaryContentSections":[{"kind":"declarations","declarations":[{"languages":["swift"],"platforms":["visionOS"],"tokens":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Food"}]}]},{"content":[{"anchor":"overview","text":"Overview","level":2,"type":"heading"},{"inlineContent":[{"type":"text","text":"Sloths love to eat the leaves and twigs they find in the rainforest canopy as they"},{"type":"text","text":" "},{"text":"slowly move around. To feed them these items, you can use the ","type":"text"},{"type":"reference","identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/twig","isActive":true},{"text":",","type":"text"},{"text":" ","type":"text"},{"type":"reference","identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/regularLeaf","isActive":true},{"type":"text","text":" and "},{"type":"reference","isActive":true,"identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/largeLeaf"},{"text":" default foods.","type":"text"}],"type":"paragraph"},{"syntax":"swift","type":"codeListing","code":["superSloth.eat(.twig)"]},{"type":"paragraph","inlineContent":[{"type":"text","text":"You can also define your own custom sloth food by providing a name and the"},{"text":" ","type":"text"},{"type":"text","text":"energy level. When the sloth eats your custom food, their energy level increases"},{"type":"text","text":" "},{"type":"text","text":"by the "},{"isActive":true,"identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/energy","type":"reference"},{"text":" of the food:","type":"text"}]},{"type":"codeListing","syntax":"swift","code":["let flower = Sloth.Food(name: \"Flower Bud\", energy: 10)","superSloth.eat(flower)"]}],"kind":"content"}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/slothcreator\/sloth\/food"]}],"references":{"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator/Sloth/Food/twig":{"url":"\/documentation\/slothcreator\/sloth\/food\/twig","type":"topic","identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/twig","title":"twig","fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"twig","kind":"identifier"},{"kind":"text","text":": "},{"preciseIdentifier":"s:12SlothCreator0A0V","text":"Sloth","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Food","preciseIdentifier":"s:12SlothCreator0A0V4FoodV","kind":"typeIdentifier"}],"kind":"symbol","role":"symbol","abstract":[{"type":"text","text":"A spindly stick."}]},"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator/Sloth/Food/largeLeaf":{"url":"\/documentation\/slothcreator\/sloth\/food\/largeleaf","type":"topic","identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/largeLeaf","title":"largeLeaf","fragments":[{"text":"static","kind":"keyword"},{"kind":"text","text":" "},{"kind":"keyword","text":"let"},{"text":" ","kind":"text"},{"text":"largeLeaf","kind":"identifier"},{"text":": ","kind":"text"},{"kind":"typeIdentifier","text":"Sloth","preciseIdentifier":"s:12SlothCreator0A0V"},{"text":".","kind":"text"},{"preciseIdentifier":"s:12SlothCreator0A0V4FoodV","text":"Food","kind":"typeIdentifier"}],"kind":"symbol","role":"symbol","abstract":[{"type":"text","text":"A large leaf."}]},"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator":{"url":"\/documentation\/slothcreator","type":"topic","abstract":[{"text":"Catalog sloths you find in nature and create new adorable virtual sloths.","type":"text"}],"images":[{"identifier":"slothCreator-icon.png","type":"icon"}],"identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator","title":"SlothCreator","role":"collection","kind":"symbol"},"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator/Sloth/Food":{"type":"topic","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"text":"Food","kind":"identifier"}],"kind":"symbol","identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food","title":"Sloth.Food","role":"symbol","abstract":[{"text":"Food that a sloth can consume.","type":"text"}],"url":"\/documentation\/slothcreator\/sloth\/food","navigatorTitle":[{"text":"Food","kind":"identifier"}]},"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator/Activity":{"abstract":[{"type":"text","text":"A type that declares an activity a Sloth can perform."}],"url":"\/documentation\/slothcreator\/activity","identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Activity","type":"topic","fragments":[{"text":"protocol","kind":"keyword"},{"kind":"text","text":" "},{"text":"Activity","kind":"identifier"}],"navigatorTitle":[{"kind":"identifier","text":"Activity"}],"role":"symbol","kind":"symbol","title":"Activity"},"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator/Sloth/Food/energy":{"type":"topic","abstract":[{"type":"text","text":"The amount of energy the food contains."}],"fragments":[{"text":"let","kind":"keyword"},{"kind":"text","text":" "},{"text":"energy","kind":"identifier"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Int","preciseIdentifier":"s:Si"}],"title":"energy","url":"\/documentation\/slothcreator\/sloth\/food\/energy","kind":"symbol","role":"symbol","identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/energy"},"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator/Sloth/Food/name":{"type":"topic","abstract":[{"text":"The name of the food.","type":"text"}],"fragments":[{"kind":"keyword","text":"let"},{"text":" ","kind":"text"},{"kind":"identifier","text":"name"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"title":"name","url":"\/documentation\/slothcreator\/sloth\/food\/name","kind":"symbol","role":"symbol","identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/name"},"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator/Sloth/Food/init(name:energy:)":{"identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/init(name:energy:)","role":"symbol","type":"topic","title":"init(name:energy:)","abstract":[{"text":"Creates food with the specified name and energy level.","type":"text"}],"url":"\/documentation\/slothcreator\/sloth\/food\/init(name:energy:)","kind":"symbol","fragments":[{"kind":"identifier","text":"init"},{"text":"(","kind":"text"},{"text":"name","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"String","preciseIdentifier":"s:SS","kind":"typeIdentifier"},{"kind":"text","text":", "},{"text":"energy","kind":"externalParam"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:Si","text":"Int","kind":"typeIdentifier"},{"kind":"text","text":")"}]},"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator/Sloth/Food/regularLeaf":{"identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/Sloth\/Food\/regularLeaf","type":"topic","title":"regularLeaf","role":"symbol","url":"\/documentation\/slothcreator\/sloth\/food\/regularleaf","abstract":[{"type":"text","text":"A regular-sized leaf."}],"fragments":[{"text":"static","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"keyword","text":"let"},{"text":" ","kind":"text"},{"text":"regularLeaf","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:12SlothCreator0A0V","kind":"typeIdentifier","text":"Sloth"},{"kind":"text","text":"."},{"text":"Food","kind":"typeIdentifier","preciseIdentifier":"s:12SlothCreator0A0V4FoodV"}],"kind":"symbol"},"slothCreator-icon.png":{"identifier":"slothCreator-icon.png","type":"image","variants":[{"traits":["2x","light"],"url":"\/images\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/slothCreator-icon@2x.png"}],"alt":"A technology icon representing the SlothCreator framework."},"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator/CareSchedule":{"title":"CareSchedule","abstract":[{"text":"A schedule to maintain the health and happiness of a sloth.","type":"text"}],"identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/CareSchedule","kind":"symbol","role":"symbol","url":"\/documentation\/slothcreator\/careschedule","navigatorTitle":[{"kind":"identifier","text":"CareSchedule"}],"fragments":[{"text":"struct","kind":"keyword"},{"kind":"text","text":" "},{"text":"CareSchedule","kind":"identifier"}],"type":"topic"},"doc://slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator/documentation/SlothCreator/FoodGenerator":{"type":"topic","fragments":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"FoodGenerator","kind":"identifier"}],"kind":"symbol","identifier":"doc:\/\/slothcreatorbuildingdoccdocumentationinxcode-3.SlothCreator\/documentation\/SlothCreator\/FoodGenerator","title":"FoodGenerator","role":"symbol","abstract":[{"type":"text","text":"A type that generates food."}],"url":"\/documentation\/slothcreator\/foodgenerator","navigatorTitle":[{"text":"FoodGenerator","kind":"identifier"}]}}}