File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ class Vec2
2929 use
3030 Common \Package \PropertyInfoPackage,
3131 Common \Package \ToArray,
32- Common \Package \ToJSON;
32+ Common \Package \ToJSON,
33+ Common \Package \ToStringAsJSON;
3334
3435 ////////////////////////////////////////////////////////////////
3536 ////////////////////////////////////////////////////////////////
@@ -111,4 +112,24 @@ static public function
111112 return new static ($ X , $ Y );
112113 }
113114
115+ ////////////////////////////////////////////////////////////////
116+ ////////////////////////////////////////////////////////////////
117+
118+ static public function
119+ FromVectorkin (mixed $ Input ):
120+ static {
121+
122+ $ Output = new static ;
123+
124+ if (is_array ($ Input )) {
125+ if (array_key_exists ('X ' , $ Input ))
126+ $ Output ->X = $ Input ['X ' ];
127+
128+ if (array_key_exists ('Y ' , $ Input ))
129+ $ Output ->Y = $ Input ['Y ' ];
130+ }
131+
132+ return $ Output ;
133+ }
134+
114135};
You can’t perform that action at this time.
0 commit comments