From d286258f7c05b1a98f9a9aea388690a85246fd87 Mon Sep 17 00:00:00 2001 From: alyx Date: Wed, 8 Jun 2022 17:43:49 +0000 Subject: Type intersecting is fully implemented. --- types.html | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 5 deletions(-) (limited to 'types.html') diff --git a/types.html b/types.html index 6794e75..3f9d74a 100644 --- a/types.html +++ b/types.html @@ -5,9 +5,32 @@ Document - + + + + + + + + +
+ console.log("Testing type intersections"); + const tistart = performance.now(); + const types = [ + //standard + new Type("int"), + new Type("bool"), + //template + new Type("List"), + new Type("List"), + new Type("List>"), + new Type("List>"), + new Type("List<(int|float)>"), + new Type("List<(float|Vector3)>"), + new Type("List"), + //union + new Type("(int|float|bool)"), + new Type("(List|bool)"), + //any + new Type("any"), + //dumb shit + new Type("List<(List<(int|float)>|Vector3)>"), + ]; + const head = document.getElementById("head"); + const body = document.getElementById("body"); - - - + for (const t of types) { + const headel = document.createElement("th"); + headel.innerText = t; + head.appendChild(headel); + + const row = document.createElement("tr"); + body.appendChild(row); + const title = document.createElement("th"); + title.innerText = t; + row.appendChild(title); + for (const t2 of types) { + const sect = document.createElement("td"); + sect.innerText = intersect(t,t2); + row.appendChild(sect); + } + } + + console.log(`Done in ${performance.now() - tistart}ms!`) + + console.log("Testing chip class...") + const node = {"ReadonlyPaletteName": "Set Rotation","ReadonlyChipName": "Set Rotation","Description": "Sets the rotation of the target player or object. Players will rotate about the vertical axis only. Will fail in the following cases: If the target object is currently held, select/frozen by the maker pen, or is the child of a gizmo. Will also fail on players that are seated.","IsBetaChip": true,"DeprecationStage": "Active","PaletteNameSource": "FirstNodeDesc","ChipNameSource": "FirstNodeDesc","NodeDescs": [{"Name": "Set Rotation","ReadonlyTypeParams": {"T": "(Player | Rec Room Object)","U": "(Vector3 | Quaternion)"},"Inputs": [{"Name": "","ReadonlyType": "exec","Description": ""},{"Name": "Target","ReadonlyType": "T","Description": ""},{"Name": "Rotation","ReadonlyType": "U","Description": ""}],"Outputs": [{"Name": "","ReadonlyType": "exec","Description": ""},{"Name": "Success","ReadonlyType": "bool","Description": ""}]}],"NodeFilters": [{"FilterPath": ["Player","Physics"]},{"FilterPath": ["Object","Physics"]}]}; + document.body.append((x=new Chip(node).root)); + document.body.appendChild(x); + + \ No newline at end of file -- cgit v1.2.3-54-g00ecf