Skip to content

Commit

Permalink
feat: adding more generics
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Apr 4, 2024
1 parent e6ca640 commit 9c4d0c6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
28 changes: 28 additions & 0 deletions models/csharp/GenericModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
1 change: 1 addition & 0 deletions models/schemas/generic/IDListVector2Data.json
Original file line number Diff line number Diff line change
@@ -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"}
1 change: 1 addition & 0 deletions models/schemas/generic/IDListVector2List.json
Original file line number Diff line number Diff line change
@@ -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"}
7 changes: 7 additions & 0 deletions src/vbl_aquarium/models/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 9c4d0c6

Please sign in to comment.