/// Eat the provided specialty sloth food. /// /// Sloths love to eat while they move very slowly through their rainforest habitats. They /// are especially happy to consume leaves and twigs, which they digest over long periods /// of time, mostly while they sleep. /// /// When they eat food, a sloth's ``energyLevel`` increases by the food's /// ``Food/energy``. mutating public func eat(_ food: Food, quantity: Int = 1) -> Int { energyLevel += food.energy * quantity return energyLevel } 4PVSDF"QQMF
/// Eat the provided specialty sloth food. /// /// Sloths love to eat while they move very slowly through their rainforest habitats. They /// are especially happy to consume leaves and twigs, which they digest over long periods /// of time, mostly while they sleep. /// /// When they eat food, a sloth's ``energyLevel`` increases by the food's /// ``Food/energy``. mutating public func eat(_ food: Food, quantity: Int = 1) -> Int { energyLevel += food.energy * quantity return energyLevel } 4PVSDF"QQMF
# Getting Started with Sloths Create a sloth and assign personality traits and abilities. ## Overview Sloths are complex creatures that require careful creation and a suitable habitat. 4PVSDF"QQMF
w 9DPEFͷ%PDVNFOUBUJPOʹग़ྗ͢Δ߹ w ʮ1SPEVDUʯʮ#VJME%PDVNFOUBUJPOɹ?‐㵰%ʯ w 8FCαΠτ͚ʹग़ྗ͢Δ߹ͳͲ w 4XJGUͷ4XJGU1BDLBHF.BOBHFS$PNNBOE1MVHJOTػೳΛ ׆༻ͨ͠ɺ4XJGU%PD$1MVHJOΛ͏ 22
% swift package --disable-sandbox preview-documentation --target <target-name> Building for debugging... Build complete! Input: /path/to/<dir-name>/Sources/<target-name>/<docc-name>.docc Template: /Applications/Xcode.app/Contents/Developer/Toolchains/ XcodeDefault.xctoolchain/usr/share/docc/render ======================================== Starting Local Preview Server Address: http://localhost:8000/documentation/<target-name> ======================================== Monitoring /path/to/<dir-name>/Sources/<target-name>/<docc-name>.docc for changes…
͑ΒΕͳ͔ͬͨ͜ͱ w ੩తͳ8FCαΠτͱͯ͠ϗεςΟϯά͢ΔͨΊͷॻ͖ग़͠ํ๏ w ग़ྗ͞ΕΔ8FCαΠτͷσβΠϯ4XJGUͷόʔδϣϯʹґଘ͢Δ w 4XJGUͷόʔδϣϯʹґଘͯ͠΄͘͠ͳ͚Εɺ (JU)VCͷBQQMFTXJGUEPDDΛ͖࣋ͬͯͯϏϧυˠ࣮ߦ͢ΕΑͦ͞͏ w ͍Ζ͍ΖΧελϚΠζͰ͖ΔՕॴ͕ଞʹ͋ΔʢͨͿΜʣ 39