Skip to content

Commit 14ca2fc

Browse files
committed
thusfar
1 parent b2e69f1 commit 14ca2fc

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/Nether/Common/Units/Vec2.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff 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
};

0 commit comments

Comments
 (0)