Inheritance: System.Web.UI.Page
示例#1
0
        public void RetirerPoint(Point pt)
        {
            int index = PA.IndexOf(pt);

            PA.Remove(pt);
            DistPA.RemoveAt(index);
        }
示例#2
0
        //-------------------------------------------
        //
        //-------------------------------------------
        private void Relancer(object param)
        {
            TG.Relance = Convert.ToInt32(ValRelanceTxt);
            if (TG.Relance <= 0)
            {
                TG.Relance = 1;
            }

            PA.Joueurs[PA.JoueurLogue].Capital   -= (PA.NiveauPourSuivre - PA.Joueurs[PA.JoueurLogue].Engagement) + TG.Relance;
            PA.Joueurs[PA.JoueurLogue].Engagement = PA.NiveauPourSuivre + TG.Relance;
            PA.NiveauPourSuivre += TG.Relance;

            Historique_ADO_SRV hist_AS = new Historique_ADO_SRV();

            if (PA.Joueurs[PA.JoueurLogue].Capital == 0)
            {
                PA.Joueurs[PA.JoueurLogue].Decision = "ALL_IN_RELANCER";
                hist_AS.AjouteHistorique(PA.Joueurs[PA.JoueurLogue].Nom + " relance ALL IN (" + TG.Relance + ")");
            }
            else
            {
                PA.Joueurs[PA.JoueurLogue].Decision = "RELANCER";
                hist_AS.AjouteHistorique(PA.Joueurs[PA.JoueurLogue].Nom + " relance de " + TG.Relance);
            }
            AppliqueDecision();
            PA.Joue("", "Texas");
        }
示例#3
0
 public void APourOrigine(Point origine)
 {
     Origine       = origine;
     DistParcourue = Origine.DistParcourue + DistPA[PA.IndexOf(Origine)];
     RetirerPoint(Origine);
     EstCulDeSac();
 }
示例#4
0
        public void AutoImplementStubProperty()
        {
            Type        tA = typeof(PA);
            TypeBuilder bA = CreateTypeBuilder(tA);

            EmitHelper.ImplementStubProperty(bA, tA.GetProperty("PublicWriteableValue"), true);
            EmitHelper.ImplementStubProperty(bA, tA.GetProperty("ProtectedWriteableValue"), true);
            Type builtTypeA = bA.CreateTypeInfo().AsType();
            PA   oA         = (PA)Activator.CreateInstance(builtTypeA);

            oA.PublicWriteableValue = 4548;
            oA.SetProtectedValues(2121);
            Assert.That(oA.PublicWriteableValue, Is.EqualTo(4548));
            Assert.That(oA.ProtectedWriteableValue, Is.EqualTo(2121));

            Type        tB = typeof(PB);
            TypeBuilder bB = CreateTypeBuilder(tB);

            EmitHelper.ImplementStubProperty(bB, tB.GetProperty("PublicWriteableValue"), true);
            EmitHelper.ImplementStubProperty(bB, tB.GetProperty("ProtectedWriteableValue"), true);
            Type builtTypeB = bB.CreateTypeInfo().AsType();
            PB   oB         = (PB)Activator.CreateInstance(builtTypeB);

            oB.PublicWriteableValue = 4548;
            oB.SetProtectedValues(2121);
            Assert.That(oB.PublicWriteableValue, Is.EqualTo(4548));
            Assert.That(oB.ProtectedWriteableValue, Is.EqualTo(2121));
            Assert.That(oB.PublicProperty, Is.EqualTo(2121 % 255));
        }
示例#5
0
        private void attenteOuAction()
        {
            TableCourante.bout_Distribuer.Visibility = Visibility.Collapsed;
            TableCourante.bout_Suivre.Visibility     = Visibility.Collapsed;
            TableCourante.bout_Abandonner.Visibility = Visibility.Collapsed;
            TableCourante.bout_Relancer.Visibility   = Visibility.Collapsed;
            TableCourante.CB_ValRelance.Visibility   = Visibility.Collapsed;
            TableCourante.bout_Gestion.Visibility    = Visibility.Collapsed;

            if (PA.GagnantPartie.Length > 0)
            {
                TableCourante.TB_MsgAttente.Text = PA.GagnantPartie + " gagne la partie!";
                return;
            }

            if (PA.Etape == "MAIN_TERMINEE_TRAITEE_OUVERTE" || PA.Etape == "MAIN_TERMINEE_TRAITEE")
            {
                // on est entre deux mains on attend que le bouton distribue la prochaine main
                if (PA.NomJoueurLogue == PA.Joueurs[PA.GetNextBouton()].Nom)
                {
                    Principal.ArreteDelaiRefresh();
                    TableCourante.bout_Distribuer.Visibility = Visibility.Visible;
                }
                else
                {
                    TableCourante.TB_MsgAttente.Text = "On que attend que " + PA.Joueurs[PA.GetNextBouton()].Nom + " passe les cartes";
                }
            }
            else
            {
                if (PA.ProchainJoueur < 0)
                {
                    return;
                    //Etape EtapeCourante = TG.SRV.Incarne<Etapes_ADO_SRV>().RecupEtapeDuneMain();
                    //PA.ProchainJoueur = EtapeCourante.ProchainJoueur;
                }

                if (PA.NomJoueurLogue == PA.Joueurs[PA.ProchainJoueur].Nom)
                {
                    Principal.ArreteDelaiRefresh();
                    int implication = PA.NiveauPourSuivre - PA.Joueurs[PA.ProchainJoueur].Engagement;
                    if (implication == 0)
                    {
                        TableCourante.bout_Suivre.Content = "GRATOS";
                    }
                    else
                    {
                        TableCourante.bout_Suivre.Content = "SUIVRE (" + implication + ")";
                    }
                    TableCourante.bout_Suivre.Visibility     = Visibility.Visible;
                    TableCourante.bout_Abandonner.Visibility = Visibility.Visible;
                    fixeRelance();
                }
                else
                {
                    TableCourante.bout_Distribuer.Visibility = Visibility.Collapsed;
                    TableCourante.TB_MsgAttente.Text         = "On attend la décision de " + PA.Joueurs[PA.ProchainJoueur].Nom;
                }
            }
        }
示例#6
0
 private void SaveParkingArea()
 {
     if (MessageBox.Show("You are about to Save new Occupency Area. Do you really want to proceed?", MessageBoxCaption, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
     {
         return;
     }
     try
     {
         PA.PA_ID = GetID();
         using (SqlConnection Conn = new SqlConnection(GlobalClass.TConnectionString))
         {
             Conn.Open();
             using (SqlTransaction tran = Conn.BeginTransaction())
             {
                 if ((int)Conn.ExecuteScalar(string.Format("SELECT COUNT(PA_ID) FROM PARKINGAREA WHERE PA_NAME = '{0}'", PA.PA_Name), transaction: tran) > 0)
                 {
                     MessageBox.Show("Occupency Area with same name already exist. Please enter another name and try again.", MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Exclamation);
                     return;
                 }
                 PA.Save(tran);
                 GlobalClass.SetUserActivityLog(tran, "Occupency Area Setting", "New", WorkDetail: "PA_ID : " + PA.PA_ID, Remarks: PA.Description);
                 tran.Commit();
             }
             MessageBox.Show("Occupency Area Saved Successfully", MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Information);
             PAList.Add(PA);
             ExecuteUndo(null);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(GlobalClass.GetRootException(ex).Message, MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
示例#7
0
        static void Main(string[] args)
        {
            PA     ob  = new PA();
            string str = ob.GetMethod();

            Console.WriteLine(str);
            Console.ReadLine();
        }
示例#8
0
        //-------------------------------------------
        //
        //-------------------------------------------
        private void Abandonner(object param)
        {
            Historique_ADO_SRV hist_AS = new Historique_ADO_SRV();

            hist_AS.AjouteHistorique(PA.Joueurs[PA.JoueurLogue].Nom + " abandonner");
            PA.Joueurs[PA.JoueurLogue].Decision = "ABANDONNER";
            AppliqueDecision();
            PA.Joue("", "Texas");
        }
示例#9
0
 public void Create(IEnumerable <Author> authors, long pid)
 {
     foreach (var author in authors)
     {
         PA pa = new PA();
         pa.AuthorId      = author.Id;
         pa.Weight        = author.Weight;
         pa.PublicationId = pid;
         Create(pa);
     }
 }
示例#10
0
 private void GestionDistribuer(object param)
 {
     PA.Numero_Main += 1;
     PA.Num_Tour     = 1;
     PA.Etape        = "PRE_FLOP";
     PA.InitJoueurs();
     PA.Eval = new Evaluateur();
     PA.NouvelleMain();
     TG.SRV.Incarne <ToursParole_ADO_SRV>().FaireMourirMourant();
     TG.SRV.Incarne <iParties_ADO_SRV>().MAJ();
     TG.SRV.Incarne <IApplicationService>().ChangerVue(new TexasTable());
 }
示例#11
0
        /*--------------------------------------------------------------
         * /
         * /---------------------------------------------------------------*/
        public void InsereEtape()
        {
            DateTime DateIns = DateTime.Now;

            PA.InitJoueurs();
            for (int i = 0; i < PA.Joueurs.Count; i++)
            {
                if (PA.Joueurs[i].Decision != "PETIT_BLIND" &&
                    PA.Joueurs[i].Decision != "GROS_BLIND" &&
                    PA.Joueurs[i].Decision != "ABANDONNER" &&
                    PA.Joueurs[i].Decision != "Muet" &&
                    PA.Joueurs[i].Decision != "MORT" &&
                    PA.Joueurs[i].Decision != "MOURANT" &&
                    PA.Joueurs[i].Decision != "ALL_IN_SUIVRE" &&
                    PA.Joueurs[i].Decision != "ALL_IN_RELANCER")
                {
                    PA.Joueurs[i].Decision = "Attente";
                }
            }

            PA.Num_Tour = 1;
            string[] TabDD  = new string[6];
            int[]    TabEng = new int[6];
            int[]    TabK   = new int[6];
            for (int i = 0; i < PA.Joueurs.Count; i++)
            {
                if (PA.Joueurs[i].Decision == null)
                {
                    TabDD[i] = "MORT";
                }
                else
                {
                    TabDD[i] = PA.Joueurs[i].Decision;
                }
                TabEng[i] = PA.Joueurs[i].Engagement;
                TabK[i]   = PA.Joueurs[i].Capital;
            }
            Croupier croupier = new Croupier(TabDD, TabEng, TabK, PA.JoueurLogue, PA.Etape, PA.Bouton);
            string   context  = "CHANGEMENT_ETAPE";

            if (PA.Etape == "PRE_FLOP")
            {
                context = "NOUVELLE_MAIN";
            }
            PA.ProchainJoueur = croupier.DetermineProchainJoueur(context);

            string ins = "insert into etapes values( " + PA.Numero + ", " + PA.Numero_Main + ", '" + PA.Etape + "', " + PA.ProchainJoueur + ", '" + DateTime.Now + "', " + PA.Num_Tour + ")";

            maBD.Commande(ins);
            TG.SRV.Incarne <ToursParole_ADO_SRV>().InsereTourParole();
        }
示例#12
0
    public static void Main(string[] args)
    {
        Fibonacci f = new Fibonacci();

        Console.WriteLine("\nFibonacci\n---------");
        Console.WriteLine($"{f.Iniciar()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}\t{f.Proximo()}");

        PA pa = new PA(10, 2);

        Console.WriteLine("\nFibonacci\n---------");
        Console.WriteLine($"{pa.Iniciar()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}\t{pa.Proximo()}");

        return;
    }
示例#13
0
        public void StartUp()
        {
                        #if DEBUG
            KFLog.Warning("ModuleCamerashot Start");
                        #endif

            if (!Equals(KFPersistenceManager.cameraRes, null))
            {
                fResWidth  = KFPersistenceManager.cameraRes;
                fResHeight = KFPersistenceManager.cameraRes;
            }
            if (!Equals(KFPersistenceManager.cameraFramerate, null))
            {
                fFrameThreshHold = KFPersistenceManager.cameraFramerate;
            }

            _vessel = GetComponent <Vessel>();
            foreach (Part PA in _vessel.parts)
            {
                // disable UnusedVariable.Compiler
                foreach (KFRepulsor RA in PA.GetComponentsInChildren <KFRepulsor>())
                {
                    kFPartCount++;
                }
                foreach (KFModuleWheel RA in PA.GetComponentsInChildren <KFModuleWheel>())
                {
                    kFPartCount++;
                }
            }
            if (kFPartCount > 1)
            {
                                #if DEBUG
                KFLog.Log("Starting camera");
                                #endif

                _cameraObject = new GameObject("ColourCam");
                _cameraObject.transform.parent = _vessel.transform;
                _cameraObject.transform.LookAt(_vessel.mainBody.transform.position);
                _cameraObject.transform.Translate(new Vector3(0, 0, -10));
                _camera = _cameraObject.AddComponent <Camera>();
                _camera.targetTexture = renderTexture;
                _camera.cullingMask   = cameraMask;

                _camera.enabled = false;
                renderTexture   = new RenderTexture(Convert.ToInt32(fResWidth), Convert.ToInt32(fResHeight), 24);
                groundShot      = new Texture2D(Convert.ToInt32(fResWidth), Convert.ToInt32(fResHeight), TextureFormat.RGB24, false);
                dustCamEnabled  = KFPersistenceManager.isDustCameraEnabled;
                isReady         = true;
            }
        }
示例#14
0
    public static void Main(string[] args)
    {
        ISequencia f = new Fibonacci();
        ISequencia p = new PA();

        Console.WriteLine("Fibonacci");
        for (int i = 0; i < 11; i++)
        {
            Console.WriteLine(f.Proximo());
        }
        Console.WriteLine("PA:");
        for (int i = 0; i < 11; i++)
        {
            Console.WriteLine(p.Proximo());
        }
    }
示例#15
0
        //-------------------------------------------
        //
        //-------------------------------------------
        private void AppliqueDecision()
        {
            int[]    TabEng = new int[6];
            int[]    TabK   = new int[6];
            string[] TabDec = new string[6];
            for (int i = 0; i < PA.Joueurs.Count; i++)
            {
                if (i < PA.Joueurs.Count)
                {
                    TabDec[i] = PA.Joueurs[i].Decision;
                    TabEng[i] = PA.Joueurs[i].Engagement;
                    TabK[i]   = PA.Joueurs[i].Capital;
                }
                else
                {
                    TabDec[i] = "MORT";
                    TabEng[i] = 0;
                    TabK[i]   = 0;
                }
            }

            PA.croupier = new Croupier(TabDec, TabEng, TabK, PA.JoueurLogue, PA.Etape, PA.Bouton);

            ToursParole_ADO_SRV tourParole = new ToursParole_ADO_SRV();

            tourParole.MAJ();

            PA.ProchainJoueur = PA.croupier.DetermineProchainJoueur("");
            Etapes_ADO_SRV etape_AS = new Etapes_ADO_SRV();

            etape_AS.MAJ();

            Mains_ADO_SRV main_AS = new Mains_ADO_SRV();

            main_AS.MAJ();
            MainsJoueurDansMainPartie(mainCourante);
            PA.Eval = new Evaluateur();

            // Conversion des Paroles en leur decision num_tour - 1 à développer
            ConvertirParole();
            PA.ConsequenceDeLaDecision("Texas");
        }
示例#16
0
        /*--------------------------------------------------------------
         * /
         * /---------------------------------------------------------------*/
        private void fixeRelance()
        {
            int RelanceMax = PA.CalculeRelanceMaximale();

            if (RelanceMax == 0)
            {
                TableCourante.bout_Relancer.Visibility = Visibility.Collapsed;
                TableCourante.CB_ValRelance.Visibility = Visibility.Collapsed;
            }
            else
            {
                TableCourante.bout_Relancer.Visibility = Visibility.Visible;
                TableCourante.CB_ValRelance.Visibility = Visibility.Visible;
                for (int i = 1; i <= RelanceMax; i++)
                {
                    TableCourante.CB_ValRelance.Items.Add(i);
                }
                TableCourante.CB_ValRelance.Text = "1";
            }
        }
示例#17
0
 private void UpdateParkingArea()
 {
     if (MessageBox.Show("Are you sure you want to Edit this Occupency Area?", MessageBoxCaption, MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
     {
         return;
     }
     try
     {
         using (SqlConnection Conn = new SqlConnection(GlobalClass.TConnectionString))
         {
             Conn.Open();
             using (SqlTransaction tran = Conn.BeginTransaction())
             {
                 if ((int)Conn.ExecuteScalar(string.Format("SELECT COUNT(PA_ID) FROM ParkingArea WHERE PA_NAME = '{0}' AND PA_ID <>{1}", PA.PA_Name, PA.PA_ID), transaction: tran) > 0)
                 {
                     MessageBox.Show("Occupency Area with same name already exist. Please enter another name and try again.", "Save Data", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                     return;
                 }
                 TParkingArea PArea = Conn.Query <TParkingArea>("SELECT * FROM ParkingArea WHERE PA_ID = @PA_ID", PA, tran).First();
                 PA.Update(tran);
                 GlobalClass.SetUserActivityLog(tran, "Occupency Area Setting", "Edit", WorkDetail: "PA_ID : " + PA.PA_ID, Remarks: Newtonsoft.Json.JsonConvert.SerializeObject(PArea));
                 tran.Commit();
             }
             MessageBox.Show("Occupency Area Updated Successfully.", MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Information);
             var pa = PAList.First(x => x.PA_ID == PA.PA_ID);
             pa.Description  = PA.Description;
             pa.Capacity     = PA.Capacity;
             pa.PA_Name      = PA.PA_Name;
             pa.VehicleType  = PA.VehicleType;
             pa.FLOOR        = PA.FLOOR;
             pa.MinVacantLot = PA.MinVacantLot;
             pa.VType        = PA.VType;
             ExecuteUndo(null);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#18
0
 private void ExecuteDelete(object obj)
 {
     if (MessageBox.Show("You are about to delete selected Occupency Area. Do you really want to proceed?", MessageBoxCaption, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
     {
         return;
     }
     try
     {
         using (SqlConnection Conn = new SqlConnection(GlobalClass.TConnectionString))
         {
             Conn.Open();
             using (SqlTransaction tran = Conn.BeginTransaction())
             {
                 TParkingArea PArea = Conn.Query <TParkingArea>("SELECT * FROM ParkingArea WHERE PA_ID = @PA_ID", PA, tran).First();
                 PA.Delete(tran);
                 GlobalClass.SetUserActivityLog(tran, "Occupency Area Setting", "Delete", WorkDetail: "PA_ID : " + PA.PA_ID, Remarks: Newtonsoft.Json.JsonConvert.SerializeObject(PArea));
                 tran.Commit();
             }
             MessageBox.Show("Occupency Area Deleted successfully.", MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Information);
             PAList.Remove(PAList.First(x => x.PA_ID == PA.PA_ID));
             ExecuteUndo(null);
         }
     }
     catch (SqlException ex)
     {
         if (ex.Number == 547)
         {
             MessageBox.Show("Selected occupency area type cannot be deleted because it has already been linked to another transaction.", MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Hand);
         }
         else
         {
             MessageBox.Show(ex.Number + " : " + ex.Message, MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
示例#19
0
        public void CreationPartie()
        {
            List <string> lstInvites = new List <string>();

            for (int i = 0; i < ListeMembres.Count; i++)
            {
                if (ListeMembres[i].Inviter)
                {
                    lstInvites.Add(ListeMembres[i].Nom);
                }
            }
            TransformeInviteEnJoueur(lstInvites);

            int numPartie = TG.SRV.Incarne <iParties_ADO_SRV>().InsereNouvellePartie(ListeJoueurs);

            //PA partieActive =
            TG.SRV.Incarne <iParties_ADO_SRV>().RecupUnePA(numPartie);
            PA.NomJoueurLogue = "certs";
            PA.JoueurLogue    = 0;
            PA.InitNouvellePartie(ListeJoueurs);

            TG.SRV.Incarne <IApplicationService>().ChangerVue(new TexasTable());
        }
示例#20
0
 public void SetUser(PA p)
 {
     this._user[p.client.GetIP()] = p;
 }
示例#21
0
        public void UpdateCharacteristics(string package)
        {
            string[] _loc3 = package.Substring(2).Split('|');
            string[] _loc5 = _loc3[0].Split(',');

            experience_actual    = double.Parse(_loc5[0]);
            experience_min_level = double.Parse(_loc5[1]);
            experience_max_level = double.Parse(_loc5[2]);

            _loc5     = _loc3[5].Split(',');
            Health    = int.Parse(_loc5[0]);
            HealthMax = int.Parse(_loc5[1]);

            _loc5      = _loc3[6].Split(',');
            energy     = int.Parse(_loc5[0]);
            energy_max = int.Parse(_loc5[1]);

            if (Initiative != null)
            {
                Initiative.Base = int.Parse(_loc3[7]);
            }
            else
            {
                Initiative = new Stats(int.Parse(_loc3[7]));
            }

            if (Prospection != null)
            {
                Prospection.Base = int.Parse(_loc3[8]);
            }
            else
            {
                Prospection = new Stats(int.Parse(_loc3[8]));
            }

            for (int i = 9; i <= 18; ++i)
            {
                _loc5 = _loc3[i].Split(',');
                int @base     = int.Parse(_loc5[0]);
                int equipment = int.Parse(_loc5[1]);
                int dons      = int.Parse(_loc5[2]);
                int boost     = int.Parse(_loc5[3]);

                switch (i)
                {
                case 9:
                    PA.ActualizeStats(@base, equipment, dons, boost);
                    break;

                case 10:
                    PM.ActualizeStats(@base, equipment, dons, boost);
                    break;

                case 11:
                    Strenght.ActualizeStats(@base, equipment, dons, boost);
                    break;

                case 12:
                    Vitality.ActualizeStats(@base, equipment, dons, boost);
                    break;

                case 13:
                    Windsom.ActualizeStats(@base, equipment, dons, boost);
                    break;

                case 14:
                    Lucky.ActualizeStats(@base, equipment, dons, boost);
                    break;

                case 15:
                    Agility.ActualizeStats(@base, equipment, dons, boost);
                    break;

                case 16:
                    Intelligence.ActualizeStats(@base, equipment, dons, boost);
                    break;

                case 17:
                    PO.ActualizeStats(@base, equipment, dons, boost);
                    break;

                case 18:
                    Summon.ActualizeStats(@base, equipment, dons, boost);
                    break;
                }
            }
        }
示例#22
0
 public void AjouterPoint(Point pt, int dist)
 {
     PA.Add(pt);
     DistPA.Add(dist);
 }
示例#23
0
 public void AddUser(PA box)
 {
     user[box.client.GetIP()] = box;
     ThreadManager.Instance.Threads[box.thread.ManagedThreadId] = box.client;
 }
示例#24
0
        public void Create(long aid, long pid)
        {
            PA pa = new PA(pid, aid);

            Create(pa);
        }