Esempio n. 1
0
        public void V2_Parse()
        {
            Vector2 result = Vector2X.Parse("3.5,-4.2");

            result.X.Should().BeApproximately(3.5f, 1e-6f);
            result.Y.Should().BeApproximately(-4.2f, 1e-6f);
        }
Esempio n. 2
0
        public void V2_ParseScientificNotation()
        {
            Vector2 result = Vector2X.Parse("-1.2e+12,2.4e-18");

            result.X.Should().BeApproximately(-1.2e+12f, 1e-6f);
            result.Y.Should().BeApproximately(2.4e-18f, 1e-6f);
        }
Esempio n. 3
0
        private Polygon ParsePolygon(string value)
        {
            var pointStrings = value.Split(' ');

            Polygon result = new Polygon();

            foreach (var pt in pointStrings)
            {
                result.Add(Vector2X.Parse(pt));
            }

            return(result);
        }