Beispiel #1
0
        public void Foreign()
        {
            vm.EnsureSlots(1);
            vm.SetSlotNull(0);

            vm.SetSlotNewForeign(0, this);

            Assert.AreEqual(this, vm.GetSlotForeign <Slots>(0));

            Assert.AreEqual(WrenType.Foreign, vm.GetSlotType(0));
        }
Beispiel #2
0
            private static void getLength(WrenVM vm)
            {
                var vector = vm.GetSlotForeign <WrenVector>(1);

                vm.SetSlotDouble(0, Math.Sqrt((vector.x * vector.x) + (vector.y * vector.y)));
            }