예제 #1
0
    public Lumiere(Mois m, Rang r) : base(m, r)
    {
        switch (m)
        {
        case Mois.Janvier:
            NomLumiere = NomLumiere.Grue;
            break;

        case Mois.Mars:
            NomLumiere = NomLumiere.Baniere;
            break;

        case Mois.Aout:
            NomLumiere = NomLumiere.Lune;
            break;

        case Mois.Novembre:
            NomLumiere = NomLumiere.Parapluie;
            break;

        case Mois.Octobre:
            NomLumiere = NomLumiere.Phenix;
            break;

        default:
            throw;
            break;
        }
    }
예제 #2
0
 public Carre(Rang RangUn, Rang RangDeux)
 {
     this.RangUn    = RangUn;
     this.RangDeux  = RangDeux;
     this.nbClients = 8;
     //initialisations par defauts
 }
        public void Test_GetRangUn()
        {
            //Arrange
            // Rang 1
            Serveur  Serveur_Rang1 = new Serveur("Dupont", "Lucas");
            ChefRang CR_Rang1      = new ChefRang("Pascal", "Henry");

            Table[] Liste_Rang1   = new Table[3];
            Rang    Expected_Rang = new Rang(Serveur_Rang1, CR_Rang1, Liste_Rang1);

            //Rang2
            Serveur  Serveur_Rang2  = Serveur_Rang1;
            ChefRang ChefRang_Rang2 = CR_Rang1;

            Table[] Liste_Rang2 = Liste_Rang1;
            Rang    Rang2       = new Rang(Serveur_Rang2, ChefRang_Rang2, Liste_Rang2);

            Carre Carre = new Carre(Expected_Rang, Rang2);

            //Action
            Rang Actual_Rang = Carre.GetRangUn();

            //Assert
            Assert.AreEqual(Expected_Rang, Actual_Rang);
        }
예제 #4
0
        public List <Rang> SimilerRangs()
        {
            Rang rang = new Rang();
            List <BaseModele> modeles = dao.Find(rang, "");

            return(modeles.Cast <Rang>().ToList());
        }
예제 #5
0
 protected AbstractCannonPartBuilder(uint id, string name, Rang rang)
 {
     _cannonPart      = new T();
     _cannonPart.Id   = id;
     _cannonPart.Name = name;
     _cannonPart.Rang = rang;
 }
예제 #6
0
 public Builder(uint id, Rang rang, CannonBaseModel model) : base(id, CannonBaseModelHelper.GetName(model),
                                                                  rang)
 {
     _cannonPart.CannonBaseType  = CannonBaseModelHelper.GetType(model);
     _cannonPart.ProjectileType  = CannonBaseModelHelper.GetProjectileType(model);
     _cannonPart.CannonBaseModel = model;
 }
예제 #7
0
        private void FoablakTestreszabas()  // a bejelentkezett dolgozó rangjától függően alakítja ki a főablak kinézetét, hogy milyen funkciók érhetőek el neki
        {
            Rang       r      = aktDolgozo.GetBeosztás();
            Visibility hidden = Visibility.Hidden;

            if (r == Rang.Adminisztrátor || r == Rang.Kapitány)
            {
                gr_feladat.Visibility = hidden;
            }
            if (r == Rang.Kapitány || r == Rang.Ornagy || r == Rang.Tiszt) // ha nem admin lép be
            {
                admin_ujfelh.Visibility = hidden;
                admin_log.Visibility    = hidden;
            }
            if (r == Rang.Adminisztrátor || r == Rang.Ornagy || r == Rang.Tiszt) // ha nem kapitány lép be
            {
                kap_kimut.Visibility = hidden;
                kap_ujbun.Visibility = hidden;
            }
            if (r == Rang.Adminisztrátor || r == Rang.Kapitány || r == Rang.Tiszt) // ha nem őrnagy lép be
            {
                orn_felkio.Visibility = hidden;
            }

            /*if(r == Rang.Adminisztrátor||r == Rang.Kapitány || r == Rang.Ornagy) // ha nem tiszt lép be
             * {
             *  tiszt_bunmod.Visibility = hidden;
             * }*/
        }
예제 #8
0
        /// <summary>
        /// Creer un instance de la class carte
        /// </summary>
        /// <param name="rank">Rang de la carte (de 7 à As) </param>
        /// <param name="color">Couleur de la carte</param>
        /// <param name="asset">La couleur de la carte est un atout, faux par defaut</param>
        public Carte(Rang rank, Couleur color, bool asset = false)
        {
            nom     = rank;
            couleur = color;
            atout   = asset;

            valeur = rankToValeur(rank, asset);
        }
예제 #9
0
 private void Feltoltes(string nev, string jelszo, Rang rang, string lakcim) // bemeneti paraméterek alapján feltölti a mezőket az ablakban
 {
     rang_cbx.ItemsSource  = Enum.GetValues(typeof(Rang));
     nev_txb.Text          = nev;
     jelszo_txb.Text       = jelszo;
     rang_cbx.SelectedItem = rang;
     lakcim_txb.Text       = lakcim;
 }
예제 #10
0
        public ChefMaster()
        {
            //Instanciation personnelle

            MH = MaitreHotel.GetInstance("Maitre", "Hotel");
            CS = CommisSalle.GetInstance("Commis", "Salle");

            CR_1 = new ChefRang("CR", "1");
            CR_2 = new ChefRang("CR", "2");
            CR_3 = new ChefRang("CR", "3");
            CR_4 = new ChefRang("CR", "4");

            SR_1 = new Serveur("SR", "1");
            SR_2 = new Serveur("SR", "2");
            SR_3 = new Serveur("SR", "3");
            SR_4 = new Serveur("SR", "4");

            //Instanciation Salle

            TB_Rang1    = new Table[4];
            TB_Rang1[0] = Table_4_Rang1_1 = new Table(4, 0, 1);
            TB_Rang1[1] = Table_4_Rang1_2 = new Table(4, 0, 2);
            TB_Rang1[2] = Table_4_Rang1_3 = new Table(4, 0, 3);
            TB_Rang1[3] = Table_4_Rang1_4 = new Table(4, 0, 4);
            Rang1       = new Rang(SR_1, CR_1, TB_Rang1);

            TB_Rang2    = new Table[4];
            TB_Rang2[0] = Table_4_Rang_2_1 = new Table(4, 0, 5);
            TB_Rang2[1] = Table_4_Rang_2_2 = new Table(4, 0, 6);
            TB_Rang2[2] = Table_4_Rang_2_3 = new Table(4, 0, 7);
            TB_Rang2[3] = Table_4_Rang_2_4 = new Table(4, 0, 8);
            Rang2       = new Rang(SR_2, CR_2, TB_Rang2);

            Carre1 = new Carre(Rang1, Rang2);

            TB_Rang3    = new Table[3];
            TB_Rang3[0] = Table_8_Rang3_1 = new Table(8, 0, 9);
            TB_Rang3[1] = Table_4_Rang3_2 = new Table(4, 0, 10);
            TB_Rang3[2] = Table_8_Rang3_3 = new Table(8, 0, 11);
            Rang3       = new Rang(SR_3, CR_3, TB_Rang3);

            TB_Rang4    = new Table[3];
            TB_Rang4[0] = Table_4_Rang_4_1 = new Table(4, 0, 12);
            TB_Rang4[1] = Table_8_Rang_4_2 = new Table(8, 0, 13);
            TB_Rang4[2] = Table_4_Rang_4_3 = new Table(4, 0, 14);
            Rang4       = new Rang(SR_3, CR_3, TB_Rang3);

            Carre2 = new Carre(Rang3, Rang4);

            Presentoire = new PresentoireSalle();
            Salle       = Salle.GetInstance(Carre1, Carre2, MH, CS, Presentoire);

            Chiffre = 0;



            InitializeComponent();
        }
예제 #11
0
 public CannonBase(Rang rang, float damage, float attackSpeed,
                   ProjectileType projectileType, float projectileSpeed,
                   CannonBaseType cannonBaseType)
 {
     Rang            = rang;
     Damage          = damage;
     AttackSpeed     = attackSpeed;
     ProjectileType  = projectileType;
     ProjectileSpeed = projectileSpeed;
     CannonBaseType  = cannonBaseType;
 }
예제 #12
0
    public Ruban(Mois m, Rang r) : base(m, r)
    {
        switch (m)
        {
        case Mois.Janvier:
            NomAnimal = Categorie.Poeme;
            break;

        case Mois.Fevrier:
            NomAnimal = Categorie.Poeme;
            break;

        case Mois.Mars:
            NomAnimal = Categorie.Poeme;
            break;

        case Mois.Avril:
            NomAnimal = Categorie.Rouge;
            break;

        case Mois.Mai:
            NomAnimal = Categorie.Rouge;
            break;

        case Mois.Juin:
            NomAnimal = Categorie.Violet;
            break;

        case Mois.Juillet:
            NomAnimal = Categorie.Rouge;
            break;

        case Mois.Septembre:
            NomAnimal = Categorie.Violet;
            break;

        case Mois.Octobre:
            NomAnimal = Categorie.Violet;
            break;

        case Mois.Novembre:
            NomAnimal = Categorie.Rouge;
            break;

        default:
            throw;
            break;
        }
    }
        public void Test_GetChefRang()
        {
            //Arrange
            Serveur  Serveur           = new Serveur("Dupont", "Lucas");
            ChefRang Expected_ChefRang = new ChefRang("Pascal", "Henry");

            Table[] Liste = new Table[3];
            Rang    Rang  = new Rang(Serveur, Expected_ChefRang, Liste);

            //Action
            ChefRang Actual_ChefRang = Rang.GetChefRang();

            //Assert
            Assert.AreEqual(Expected_ChefRang, Actual_ChefRang);
        }
        public void GetListeTables()
        {
            //Arrange
            Serveur  Serveur  = new Serveur("Dupont", "Lucas");
            ChefRang ChefRang = new ChefRang("Pascal", "Henry");

            Table[] Expected_Liste = new Table[3];
            Rang    Rang           = new Rang(Serveur, ChefRang, Expected_Liste);

            //Action
            Table[] Actual_Liste = Rang.GetListeTables();

            //Assert
            Assert.AreEqual(Expected_Liste, Actual_Liste);
        }
        public void Test_GetServeur()
        {
            //Arrange
            Serveur  Expected_Serveur = new Serveur("Dupont", "Lucas");
            ChefRang ChefRang         = new ChefRang("Pascal", "Henry");

            Table[] Liste = new Table[3];
            Rang    Rang  = new Rang(Expected_Serveur, ChefRang, Liste);

            //Action
            Serveur Actual_Serveur = Rang.GetServeur();

            //Assert
            Assert.AreEqual(Expected_Serveur, Actual_Serveur);
        }
        private Barrel GetBarrel(Rang rang)
        {
            var         amountOfModels   = Enum.GetNames(typeof(BarrelModel)).Length;
            var         chosenModelIndex = new Random().Next(0, amountOfModels);
            BarrelModel model;

            Enum.TryParse(Enum.GetNames(typeof(BarrelModel))[chosenModelIndex], out model);

            return(new Barrel.Builder(/* MAKE ID GENERATOR */ 0, rang, model)
                   .SetDamageMultiplier(GetRandomValue(CannonConfig.Barrel.DamageMultiplierMinCommon,
                                                       CannonConfig.Barrel.DamageMultiplierMaxCommon))
                   .SetAttackSpeedMultiplier(GetRandomValue(CannonConfig.Barrel.AttackSpeedMultiplierMinCommon,
                                                            CannonConfig.Barrel.AttackSpeedMultiplierMaxCommon))
                   .SetAdditionalShotsAmount(0) //TODO Add MultiBarrelSupport
                   .Build());
        }
        private CannonBase GetCannonBase(Rang rang)
        {
            var             amountOfModels   = Enum.GetNames(typeof(CannonBaseModel)).Length;
            var             chosenModelIndex = new Random().Next(0, amountOfModels);
            CannonBaseModel model;

            Enum.TryParse(Enum.GetNames(typeof(CannonBaseModel))[chosenModelIndex], out model);

            return(new CannonBase.Builder(/* MAKE ID GENERATOR */ 0, rang, model)
                   .SetDamage(GetRandomValue(CannonConfig.CannonBase.DamageMinCommon,
                                             CannonConfig.CannonBase.DamageMaxCommon))
                   .SetAttackSpeed(GetRandomValue(CannonConfig.CannonBase.AttackSpeedMinCommon,
                                                  CannonConfig.CannonBase.AttackSpeedMaxCommon))
                   .SetProjectileSpeed(GetRandomValue(CannonConfig.CannonBase.ProjectileSpeedMinCommon,
                                                      CannonConfig.CannonBase.ProjectileSpeedMaxCommon))
                   .Build());
        }
예제 #18
0
    public Animal(Mois m, Rang r) : base(m, r)
    {
        switch (m)
        {
        case Mois.Fevrier:
            NomAnimal = NomAnimal.Rossignol;
            break;

        case Mois.Avril:
            NomAnimal = NomAnimal.Coucou;
            break;

        case Mois.Mai:
            NomAnimal = NomAnimal.Pont;
            break;

        case Mois.Juin:
            NomAnimal = NomAnimal.Papillon;
            break;

        case Mois.Juillet:
            NomAnimal = NomAnimal.Sanglier;
            break;

        case Mois.Aout:
            NomAnimal = NomAnimal.Oie;
            break;

        case Mois.Septembre:
            NomAnimal = NomAnimal.Sake;
            break;

        case Mois.Octobre:
            NomAnimal = NomAnimal.Cerf;
            break;

        case Mois.Novembre:
            NomAnimal = NomAnimal.Hirondelle;
            break;

        default:
            throw;
            break;
        }
    }
        public void Test_GetRang()
        {
            //Arrange
            Serveur  Lucas = new Serveur("Dupont", "Lucas");
            ChefRang Henry = new ChefRang("Dupont", "Lucas");

            Table[] Liste = new Table[3];

            Rang Expected_Rang = new Rang(Lucas, Henry, Liste);
            //Le rang d'une variable est defini a la construction d'un objet Rang ; Null sinon


            //Action
            Rang Actual_Rang = Henry.GetRang();

            //Assert
            Assert.AreEqual(Expected_Rang, Actual_Rang);
        }
        public void Test_SetRang()
        {
            //Arrange
            Serveur  Lucas  = new Serveur("Dupont", "Lucas");
            Serveur  Thomas = new Serveur("Dupont", "Thomas");
            ChefRang Henry  = new ChefRang("Dupont", "Lucas");

            Table[] Liste  = new Table[3];
            Table[] Liste2 = new Table[4];

            Rang Rang          = new Rang(Lucas, Henry, Liste);
            Rang Expected_Rang = new Rang(Thomas, Henry, Liste2);

            //Rang qui n'affecte pas Lucas

            //Action
            Lucas.SetRang(Expected_Rang);

            //Assert
            Assert.AreEqual(Expected_Rang, Lucas.GetRang());
        }
예제 #21
0
        private int rankToValeur(Rang rank, bool asset)
        {
            switch (rank)
            {
            default: return(-1);

            case Rang.As: return(11);

            case Rang.Roi: return(4);

            case Rang.Dame: return(3);

            case Rang.Valet: return(asset ? 20 : 2);

            case Rang.Dix: return(10);

            case Rang.Neuf: return(asset ? 14 : 0);     // float 0.09

            case Rang.Huit: return(0);                  // float 0.08

            case Rang.Sept: return(0);                  // float 0.07
            }
        }
 //constructor voor Kaart
 public Kaart(Kleur kleur, Teken teken, Rang rang)
 {
     Kaart_Kleur = kleur;
     Kaart_Rang  = rang;
     Kaart_Teken = teken;
 }
예제 #23
0
		public Dolgozó(Rang Rang, string jelszó, string név, string lakcím, decimal személyiazonosító)
            :base(személyiazonosító,lakcím,név)
        {
            this.beosztás = Rang;
            this.jelszó = jelszó;
		}
예제 #24
0
        //public static Indeks GetIndeks(Indeks lv)          //Metode for at hente ID fra Land_Verdensdel tabellen
        //{
        //    //using (SqlConnection connection = new SqlConnection(connectionString))
        //    //{
        //    //    string sql2 = "Select Indeks_ID from  Indeks where Land_ID =@land_id";          //henter Landverdensdel ID med LandID
        //    //    using (SqlCommand command = new SqlCommand(sql2, connection))
        //    //    {
        //    //        command.Parameters.AddWithValue("@Land_ID", lv.Land_ID);


        //    //        connection.Open();
        //    //        SqlDataReader reader = command.ExecuteReader();
        //    //        while (reader.Read())
        //    //        {
        //    //            lv.Land_ID = reader.GetInt32(1);
        //    //        }

        //    //        reader.Close();
        //    //    }


        //    //}
        //    //return lv;
        //}
        public static Rang InsertRang(Rang r, Land l)   //Method for at indtaste data i Rang tabellen
        {
            int result     = 0;
            int rangLandId = 0;

            using (SqlConnection cnn = new SqlConnection(connectionString))
            {
                cnn.Open();
                string sql = "select Land_ID,Rang_ID from Rang where Rang=@Rang";          //henter Land_ID og Rang_ID fra Rang tabellen
                using (SqlCommand command = new SqlCommand(sql, cnn))
                {
                    command.Parameters.AddWithValue("@Rang", r.Rang_Nummer);

                    SqlDataReader reader = command.ExecuteReader();
                    while (reader.Read())
                    {
                        rangLandId = reader.GetInt32(0);
                        r.Rang_ID  = reader.GetInt32(1);
                    }
                    reader.Close();
                }

                if (r.Rang_ID > 0 && l.Land_ID == rangLandId)               // hvis Rang_ID og Land_ID findes så bliver den ikke indsat
                {
                    return(r);
                }
                else if (r.Rang_ID > 0)                                     // hvis Rang_ID findes så sker der ikke noget
                {
                    return(null);
                }
                else if (r.Rang_ID == 0)                                                                             // hvis Rang_ID ikke findes så bliver dne indsat
                {
                    string sql1 = "Insert into Rang(Land_ID, Rang,Fødselsrate) values(@Land_ID,@Rang,@Fødselsrate)"; //indsætter data i Rang tabellen
                    using (SqlCommand command = new SqlCommand(sql1, cnn))
                    {
                        command.Parameters.AddWithValue("@Land_ID", l.Land_ID);
                        command.Parameters.AddWithValue("@Rang", r.Rang_Nummer);
                        //command.Parameters.AddWithValue("@Statistik_id", 1);
                        command.Parameters.AddWithValue("@Fødselsrate", r.Fødselsrate);
                        //cnn.Open();
                        result = command.ExecuteNonQuery();
                    }
                    string sql2 = "select Rang_ID from  Rang where Rang=@Rang";             // henter Rang_ID som lige er blevet indsat
                    using (SqlCommand command = new SqlCommand(sql2, cnn))
                    {
                        command.Parameters.AddWithValue("@Rang", r.Rang_Nummer);


                        //cnn.Open();
                        SqlDataReader reader = command.ExecuteReader();
                        while (reader.Read())
                        {
                            r.Rang_ID = reader.GetInt32(0);
                        }
                        reader.Close();
                    }

                    cnn.Close();
                }
            }
            return(r);
        }
예제 #25
0
 private void InitializeSeparatorLins()
 {
     var bestSeparator = new BestSeparator<MKT_Point>();
     var roulette = new Roulette<MKT_Point>();
     var tournament = new Tournament<MKT_Point>();
     var rang = new Rang<MKT_Point>();
     bestSeparatorName = bestSeparator.GetType().Name;
     separators = new Dictionary<string, ISeparator<MKT_Point>>
     {
         {bestSeparatorName, bestSeparator},
         {roulette.GetType().Name, roulette},
         {tournament.GetType().Name, tournament},
         {rang.GetType().Name, rang}
     };
 }
예제 #26
0
 public Builder(uint id, Rang rang, BarrelModel model) : base(id, BarrelModelHelper.GetName(model), rang)
 {
     _cannonPart.BarrelType  = BarrelModelHelper.GetType(model);
     _cannonPart.BarrelModel = model;
 }
예제 #27
0
 public Plante(Mois m, Rang r) : base(m, r)
 {
 }
예제 #28
0
		/// 
		/// <param name="jelszó"></param>
		/// <param name="beosztás"></param>
		/// <param name="név"></param>
		/// <param name="azonosító"></param>
		/// <param name="lakcím"></param>
		public void ÚjDolgozó(string jelszó, Rang beosztás, string név, decimal azonosító, string lakcím){

		}
예제 #29
0
    /// <summary>
    /// Le MH defini la table qui sera attribue aux clients et appelle le Chef de rang pour qu'il amene les clients a la table
    /// </summary>

    public Table AttribueTable(Salle Salle, Clients Clients, Boolean AReserve)
    {
        //defini la table (si pas de reservation)
        // si resa (rajouter un if) Table_Attribue = TableReserve.Table   << !!

        Carre    CarreTemp      = null;
        Rang     Rangtemp       = null;
        Table    Table_attribue = null;
        ChefRang CR_Table       = null;
        Boolean  Table_vide     = false;

        int Carre = 1;

        //balaye les differents rang
        //if (TableReserve == false)
        //{
        while (Table_vide == false)
        {
            switch (Carre)
            {
            case 1:
                //Rang UN
                CarreTemp = Salle.GetCarreUn();
                Rangtemp  = CarreTemp.GetRangUn();
                break;

            case 2:
                //Rang DEUX
                //CarreTemp = Salle.GetCarreUn();
                Rangtemp = CarreTemp.GetRangDeux();
                break;

            case 3:
                //Rang TROIS
                CarreTemp = Salle.GetCarreDeux();
                Rangtemp  = CarreTemp.GetRangUn();
                break;

            case 4:
                //Rang QUATRE
                //CarreTemp = Salle.GetCarreDeux();
                Rangtemp = CarreTemp.GetRangDeux();
                break;

            case 5:
                //pas de table dispo
                //Message GUI
                break;
            }


            foreach (Table TBLE in Rangtemp.GetListeTables())
            {
                if ((TBLE.GetNombrePersonnes() == 0) && (Clients.GetNBClients() <= TBLE.GetNombreChaises()))
                {
                    Table_vide     = true;
                    Table_attribue = TBLE;
                    break;
                }
            }
            Carre++;
        }
        //}

        //Demander au CR concerné
        CR_Table = Rangtemp.GetChefRang();

        CR_Table.PlaceClient(Table_attribue, Clients);

        return(Table_attribue);
    }
 public void SetRang(Rang Rang)
 {
     this.Rang = Rang;
 }
예제 #31
0
        public bool isCarte(string description)
        {
            char[] carteChar = description.ToUpper().ToCharArray();

            // too many character
            if (carteChar.Length > 3)
            {
                return(false);
            }

            // too few character
            if (carteChar.Length < 2)
            {
                return(false);
            }

            // in case input is DIX (10) AS = 'A' DIX = '1' ou "10"
            if (carteChar.Length == 3)
            {
                carteChar[0] = '1';
                carteChar[1] = carteChar[2];
            }



            switch (carteChar[0])
            {
            default: return(false);

            case 'A': nom = Rang.As;
                break;

            case 'R': nom = Rang.Roi;
                break;

            case 'D': nom = Rang.Dame;
                break;

            case 'V': nom = Rang.Valet;
                break;

            case '1': nom = Rang.Dix;
                break;

            case '9': nom = Rang.Neuf;
                break;

            case '8': nom = Rang.Huit;
                break;

            case '7': nom = Rang.Sept;
                break;
            }

            switch (carteChar[1])
            {
            default: return(false);

            case 'D': couleur = Couleur.Carreau;
                break;

            case 'S': couleur = Couleur.Pique;
                break;

            case 'C': couleur = Couleur.Trefle;
                break;

            case 'H': couleur = Couleur.Coeur;
                break;
            }

            valeur = rankToValeur(nom, false);

            //all ok
            return(true);
        }