Struct
Sloth
A model representing a sloth.
Sloths are mammals known for their slowness of movement. They spend most of their lives hanging upside down in trees.
You can create a sloth using the init_sloth/3 initializer, or
create a randomly generated sloth using Generators/generate_sloth/1:
habitat := Sloth.init_habitat(is_humid = true, is_warm = true)
sloth := Generators.generate_sloth(habitat)
Declaration
Sloth :: struct
Values
name
The name of the sloth.
Declaration
name: string
color
The color of the sloth.
Declaration
color: Color
power
The power of the sloth.
Declaration
power: Power
energy_level
The energy level of the sloth.
Sloths have a very low metabolic rate, so their energy level is often low as well. It’s important to check their energy level often, and offer them food or opportunities to sleep before asking them to perform an activity or exercise.
You can increase the sloth’s energy level by asking them to sloth_eat/3 or sloth_sleep/3.
Declaration
energy_level: int
schedule
The care schedule of the sloth.
A care schedule maintains the health and happiness of the sloth.
Declaration
schedule: Schedule