示例#1
0
文件: Slots.cs 项目: ypyf/IronWren
        public void Double()
        {
            vm.EnsureSlots(1);
            vm.SetSlotNull(0);

            vm.SetSlotDouble(0, 200001);

            Assert.AreEqual(200001, vm.GetSlotDouble(0));

            Assert.AreEqual(WrenType.Number, vm.GetSlotType(0));
        }
示例#2
0
文件: Mapper.cs 项目: ypyf/IronWren
 public static void Sin(WrenVM vm)
 {
     vm.SetSlotDouble(0, Math.Sin(vm.GetSlotDouble(1)));
 }
示例#3
0
文件: Mapper.cs 项目: ypyf/IronWren
 public static void GetPi(WrenVM vm)
 {
     vm.SetSlotDouble(0, Math.PI);
 }
示例#4
0
文件: Mapper.cs 项目: ypyf/IronWren
 private void getY(WrenVM vm)
 {
     vm.SetSlotDouble(0, y);
 }
示例#5
0
文件: Mapper.cs 项目: ypyf/IronWren
 private void getX(WrenVM vm)
 {
     vm.SetSlotDouble(0, x);
 }
示例#6
0
文件: Mapper.cs 项目: ypyf/IronWren
            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)));
            }