The Animal class

In order to store information about animals, we will create a class named Animal. This class will be very simple, but it will have to be shared by both the client and the server. Indeed, the server will serialize several instances of this class, which means that the client will need this class to be able to unserialize it.

So, let's see how this class looks:

package zooKeeper;

class Animal
{
   public var name : String;
   public var number : Int;
   
   public function new()
   {
      name = "";
      number = 0;
   }
}

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.