I think that I shall never see / A poem lovely as a tree (Joyce Kilmer 1888-1918)
In the context of this simulation, a tree is an object. Objects have state and functionality.
The state of a tree might involve:
These MIGHT be mapped to instance variables:
The state of an object can be encapsulated in instance variables. But when a lot of objects are likely to share the same state, it helps to put them all in the same class. This motivates a big idea:
We have two kinds of tree. Why not have a PineTree class and an OakTree class. Both of these classes are descended from a Tree class. This way, species-dependent data (like burn time) can be assigned in the constructor rather than specifically assigned each time we need one tree or another. And we can eliminate the need for an instance variable indicating whether a Tree is a PineTree or an OakTree because that information is inherent in the Tree's class.
The functionality of a tree might include:
These MIGHT be mapped into methods: