From 9c4d0c6e6c251564c1285c833b49583190d41e40 Mon Sep 17 00:00:00 2001 From: Dan Birman Date: Wed, 3 Apr 2024 19:57:58 -0700 Subject: [PATCH] feat: adding more generics --- models/csharp/GenericModels.cs | 28 +++++++++++++++++++ models/schemas/generic/IDListVector2Data.json | 1 + models/schemas/generic/IDListVector2List.json | 1 + src/vbl_aquarium/models/generic.py | 7 +++++ 4 files changed, 37 insertions(+) create mode 100644 models/schemas/generic/IDListVector2Data.json create mode 100644 models/schemas/generic/IDListVector2List.json diff --git a/models/csharp/GenericModels.cs b/models/csharp/GenericModels.cs index 60b90d2..9da84ac 100644 --- a/models/csharp/GenericModels.cs +++ b/models/csharp/GenericModels.cs @@ -235,6 +235,34 @@ public IDListStringList(string[] iDs, string[] values) } +[Serializable] +public struct IDListVector2Data +{ + public string[] IDs; + public Vector2 Value; + + public IDListVector2Data(string[] iDs, Vector2 value) + { + IDs = iDs; + Value = value; + } +} + + +[Serializable] +public struct IDListVector2List +{ + public string[] IDs; + public Vector2[] Values; + + public IDListVector2List(string[] iDs, Vector2[] values) + { + IDs = iDs; + Values = values; + } +} + + [Serializable] public struct IDListVector3Data { diff --git a/models/schemas/generic/IDListVector2Data.json b/models/schemas/generic/IDListVector2Data.json new file mode 100644 index 0000000..0f63073 --- /dev/null +++ b/models/schemas/generic/IDListVector2Data.json @@ -0,0 +1 @@ +{"$defs": {"Vector2": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}}, "title": "Vector2", "type": "object"}}, "properties": {"IDs": {"items": {"type": "string"}, "title": "Ids", "type": "array"}, "Value": {"$ref": "#/$defs/Vector2"}}, "required": ["IDs", "Value"], "title": "IDListVector2Data", "type": "object"} \ No newline at end of file diff --git a/models/schemas/generic/IDListVector2List.json b/models/schemas/generic/IDListVector2List.json new file mode 100644 index 0000000..eab9d45 --- /dev/null +++ b/models/schemas/generic/IDListVector2List.json @@ -0,0 +1 @@ +{"$defs": {"Vector2": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}}, "title": "Vector2", "type": "object"}}, "properties": {"IDs": {"items": {"type": "string"}, "title": "Ids", "type": "array"}, "Values": {"items": {"$ref": "#/$defs/Vector2"}, "title": "Values", "type": "array"}}, "required": ["IDs", "Values"], "title": "IDListVector2List", "type": "object"} \ No newline at end of file diff --git a/src/vbl_aquarium/models/generic.py b/src/vbl_aquarium/models/generic.py index 1440dd6..e1266e3 100644 --- a/src/vbl_aquarium/models/generic.py +++ b/src/vbl_aquarium/models/generic.py @@ -80,6 +80,13 @@ class BoolList(VBLBaseModel): class IDList(VBLBaseModel): ids: list[str] = Field(..., alias="IDs") +class IDListVector2Data(VBLBaseModel): + ids: list[str] = Field(..., alias="IDs") + value: Vector2 + +class IDListVector2List(VBLBaseModel): + ids: list[str] = Field(..., alias="IDs") + values: list[Vector2] class IDListVector3Data(VBLBaseModel): ids: list[str] = Field(..., alias="IDs")