コード例 #1
0
        static void Main(string[] args)
        {
            string rawinputs;
            CSBPod PodMyG  = new CSBPod();
            CSBPod PodMyH  = new CSBPod();
            CSBPod PodHisG = new CSBPod();
            CSBPod PodHisH = new CSBPod();

            // read Track
            int      laps            = int.Parse(Console.ReadLine());
            int      checkpointCount = int.Parse(Console.ReadLine());
            CSBTrack Track           = new CSBTrack(laps, checkpointCount);

            for (int i = 0; i < Track.CPNumber; i++)
            {
                rawinputs = Console.ReadLine();
                Track.AddCheckPoint(i, rawinputs);
            }
            // game loop
            while (true)
            {
                // read Pods
                rawinputs = Console.ReadLine();
                PodMyG.Update(rawinputs, Track);
                rawinputs = Console.ReadLine();
                PodMyH.Update(rawinputs, Track);
                rawinputs = Console.ReadLine();
                PodHisG.Update(rawinputs, Track);
                rawinputs = Console.ReadLine();
                PodHisH.Update(rawinputs, Track);

                // Write an action using Console.WriteLine()
                // To debug: Console.Error.WriteLine("Debug messages...");

                // Console.Error.WriteLine("### FMCAS A");
                PodMyG.FMCAS(PodMyH, PodHisG, PodHisH);
                // PodMyG.Debug();

                // Console.Error.WriteLine("### FMCAS B");
                PodMyH.FMCAS(PodMyG, PodHisG, PodHisH);
                // PodMyH.Debug();

                // Console.Error.WriteLine("### AFCSMOVE A");
                Console.WriteLine(PodMyG.AFCSMOVE());
                // Console.Error.WriteLine("### AFCSMOVE B");
                Console.WriteLine(PodMyH.AFCSMOVE());
            }
        }
コード例 #2
0
        // FMCAS //
        public void FMCAS(CSBPod MyFriend, CSBPod MyFoeG, CSBPod MyFoeH)
        {
            // etape 1 : calculer la difference entre mon vecteur vitesse et celui des autres pods //
            // etape 2 : pour les pods pour lequels la difference de vecteur vitesse est importante, si un impact est probable, on utilise le SHIELD //

            // if (CSBCompute.DistAB(p_PosMySpeed, MyFriend.p_PosMySpeed) > C_DeltaSpeedShieldTrigger && CSBCompute.DistAB(p_NextPosEstimated, MyFriend.p_NextPosEstimated) < C_DeltaDistShieldTrigger)
            // { p_UseShieldCommand = true; }
            if (CSBCompute.DistAB(p_PosMySpeed, MyFoeG.p_PosMySpeed) > C_DeltaSpeedShieldTrigger && CSBCompute.DistAB(p_NextPosEstimated, MyFoeG.p_NextPosEstimated) < C_DeltaDistShieldTrigger)
            {
                p_UseShieldCommand = true;
            }
            if (CSBCompute.DistAB(p_PosMySpeed, MyFoeH.p_PosMySpeed) > C_DeltaSpeedShieldTrigger && CSBCompute.DistAB(p_NextPosEstimated, MyFoeH.p_NextPosEstimated) < C_DeltaDistShieldTrigger)
            {
                p_UseShieldCommand = true;
            }
        }