Ejemplo n.º 1
0
        /// <summary>
        /// Constructs a new WorldCoordinate at the given position.
        /// <para>If clampSubposition is false, subposition values not within 0-1 will be added to the
        /// new <see cref="WorldCoordinate"/>'s sector position.</para>
        /// For instance, setting the sector to 1 and subposition 1.5 would place the new <see cref="WorldCoordinate"/>
        /// at sector 2, subposition 0.5.
        /// </summary>
        /// <param name="sector">The new <see cref="WorldCoordinate"/>'s sector position.</param>
        /// <param name="subposition">The new <see cref="WorldCoordinate"/>'s subposition within its sector.</param>
        /// <param name="clampSubposition">Whether to clamp subposition between 0 and 1, or add excess
        /// position to the sector value.</param>
        public WorldCoordinate(int sector, float subposition, bool clampSubposition = true)
        {
            if (clampSubposition)
            {
                Sector      = sector;
                Subposition = HMath.Clamp(subposition, 0, 1 - float.Epsilon);
            }
            else
            {
                int diff = HMath.FloorToInt(subposition);

                Sector      = sector + diff;
                Subposition = subposition - diff;
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("any key start");
            Console.ReadKey();
            var AO1 = CompilerHelper.ASyncBuild_MHX_DATA(new[] { "demo.exe" });

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            int index = 0;

            while (AO1.isDone == false)
            {
                //Console.SetCursorPosition(index, 2);
                Console.Write(".");
                index++;
                index = HMath.Clamp(index, 0, 100);
                //Console.SetCursorPosition(0, 3);
                Console.WriteLine(AO1.Log);
                Thread.Sleep(500);
            }
            Console.WriteLine();
            Console.WriteLine("FINISHED 1");
            var AO2 = Compiler.AsyncTryComplire("输出.exe");

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            index = 0;
            while (AO2.isDone == false)
            {
                Console.Write(".");
                index++;
                index = HMath.Clamp(index, 0, 100);
                Console.WriteLine(AO1.Log);
                Thread.Sleep(500);
            }

            Console.WriteLine();
            Console.WriteLine("ALL FINISHED..");
            Console.WriteLine("Any key esc.");
            Console.ReadKey();
        }