Time for action – Managing a fridge
We are going to create software to manage a fridge. We want to be able to add meals inside it, and to list what is in it. Ok, let's start!
- Create a folder that is going to hold your project's files.
- Create two folders inside it: a
src
folder and abin
folder. - In your
src
folder, create aMyFridge
folder. This way, we now have aMyFridge
package. - In the
MyFridge
package, create aFridge.hx
file with the following code inside it:package MyFridge; class Fridge { public static var meals = new List<Meals>(); }
- This way, our fridge will hold a list of meals inside it. We can make this variable static because we will only have one fridge.
- Now, in the
MyFridge
package, create a file namedMeal.hx
and write the following ...
Get haXe 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.