toJSON() {
    return {
      name: this.name,
      color: this.color,
      maxHealth: this.maxHealth,
    };
  }
/**
   * Customizes the JSON stringification behavior of the unit.
   *
   * @returns {Object} The value to be serialized.
   */
Customizes the JSON stringification behavior of the unit.
@returns {Object} The value to be serialized.
Customizes the JSON stringification behavior of the unit . @returns { Object } The value to be serialized .
toJSON() {
    return {
      name: this.name,
      color: this.color,
      maxHealth: this.maxHealth,
    };
  }
toJSON ( ) { return { name : this . name , color : this . color , maxHealth : this . maxHealth , } ; }
Customizes the JSON stringification behavior of the unit.
Customizes the JSON stringification behavior of the unit .