public Combattant(string nom, int vie, int capacite, int typeCaractere)
 {
     this.nom              = nom;
     this.vie              = vie;
     this.capacite         = capacite;
     this.caractereFactory = new CaractereFactory();
     this.caractere        = this.caractereFactory.CreateCaractere(typeCaractere);
     this.visite           = new Stack <Case>();
     this.nonPossible      = new List <Case>();
     this.listAccessoire   = new List <Accessoire>();
 }
Esempio n. 2
0
        /// <summary>
        /// Tenta remover letras de um número
        /// </summary>
        /// <returns>O número limpo, sem letras</returns>
        public double RemoveLetras(string Numero)
        {
            var Caracteres = new string[] { "A", "B", "C", "D", "E", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Ç", "~", "´", "-", "_", "!", "?", "`", "{", "[", "}", "]", "(", ")", ":", ";", "$", "*", "'", "\"", "&", "#" };
            var NumeroNovo = Numero.ToLower();

            foreach (string Caractere in Caracteres)
            {
                NumeroNovo = NumeroNovo.Replace(Caractere.ToLower(), "");
            }
            return(double.Parse(NumeroNovo));
        }
Esempio n. 3
0
        private void ChangePolice(Caractere type)
        {
            FontStyle nouveauStyle = richTextBoxTexte.SelectionFont.Style;

            switch (type)
            {
            case Caractere.Gras:
                if (richTextBoxTexte.SelectionFont.Bold)
                {
                    nouveauStyle ^= FontStyle.Bold;
                }
                else
                {
                    nouveauStyle |= FontStyle.Bold;
                }
                break;

            case Caractere.Italique:
                if (richTextBoxTexte.SelectionFont.Italic)
                {
                    nouveauStyle ^= FontStyle.Italic;
                }
                else
                {
                    nouveauStyle |= FontStyle.Italic;
                }
                break;

            case Caractere.Barre:
                if (richTextBoxTexte.SelectionFont.Strikeout)
                {
                    nouveauStyle ^= FontStyle.Strikeout;
                }
                else
                {
                    nouveauStyle |= FontStyle.Strikeout;
                }
                break;

            case Caractere.Souligne:
                if (richTextBoxTexte.SelectionFont.Underline)
                {
                    nouveauStyle ^= FontStyle.Underline;
                }
                else
                {
                    nouveauStyle |= FontStyle.Underline;
                }
                break;
            }

            richTextBoxTexte.SelectionFont = new Font(richTextBoxTexte.SelectionFont, nouveauStyle);
        }
Esempio n. 4
0
        public char GetCaractere()
        {
            if (Caractere.Trim().Length == 0)
            {
                throw new Exception("Caractere não informado.");
            }
            else if (Caractere.Length != 1)
            {
                throw new Exception("Caractere inválido.");
            }

            return(Caractere.Trim()[0]);
        }
Esempio n. 5
0
    public GenerationDonnees()
    {
        GameObject player = GameObject.Find("Player");
        GameObject envs   = GameObject.Find("Environnements");
        GameObject spec   = GameObject.Find("Specificites");
        GameObject esps   = GameObject.Find("Especes");
        GameObject carac  = GameObject.Find("Caracteres");
        //Initialisation du premier environnement
        Caractere volant = new Caractere();

        volant.name    = "Vol";
        volant.facteur = 3;
        volant.type    = "Defense";
        volant.pourcentagePopulation = 100;
        Caractere plume = new Caractere();

        plume.name    = "Plumes Colorées";
        plume.facteur = 1;
        plume.type    = "Reproduction";
        plume.pourcentagePopulation = 100;

        Espece pigeon = new Espece();

        pigeon.name             = "Pigeon";
        pigeon.population       = 10;
        pigeon.reproductionRate = 1.15f;
        pigeon.caractere.SetValue(volant, 0);

        Specificite predateur = new Specificite();

        predateur.name    = "Lion";
        predateur.facteur = 3;
        predateur.counter.SetValue(volant, 0);
        predateur.type = "Mortalite";
        Environnement premier = new Environnement();

        premier.name = "Plaine tranquille";
        premier.specificites.SetValue(predateur, 0);
        premier.especes.SetValue(pigeon, 0);
        Debug.Log("Done");
    }