diff --git a/lib/structs/JsonSerializable.dart b/lib/structs/JsonSerializable.dart new file mode 100644 index 0000000..3f6bc30 --- /dev/null +++ b/lib/structs/JsonSerializable.dart @@ -0,0 +1,21 @@ +import 'dart:convert'; + +abstract class IJsonSerializable { + /// Encode json and return as String + String encode() { + return json.encode(toJson()); + } + + /// Returns a Json Object + Map toJson(); + + /// Decodes json and returns the instance + static IJsonSerializable fromJson(String js) { + throw UnimplementedError(); + } + + /// Decodes json object + static IJsonSerializable decode(Map js) { + throw UnimplementedError(); + } +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 7b449b4..1d8c43c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: libac_dart description: "Aria's Creations code library" -version: 1.2.071124+1630 +version: 1.2.071224+2114 homepage: "https://zontreck.com"