Ejemplo n.º 1
0
        // Player health input verification
        public string health_Retrieval()
        {
            InputBoxValidation validation = delegate(string val)
            {
                double value;
                if (val == "" || val == "0")
                {
                    return("It has to be living...");
                }
                if (double.TryParse(val, out value) == false)
                {
                    return("I can't actually read.");
                }
                if (value < 0)
                {
                    return("Is that like mutilating the dead?");
                }
                if (value % 1 != 0)
                {
                    return("How is that supposed to work?");
                }
                return("");
            };

            if (InputBoxVal.Show("How strong will your enemy be?", "Enemy's Health:", ref enemyHealthText, validation) == DialogResult.OK)
            {
                return(enemyHealthText);
            }
            return(enemyHealthText);
        }
Ejemplo n.º 2
0
        // Player name input verification
        public string name_Retrieval()
        {
            InputBoxValidation validation = delegate(string val)
            {
                if (val == "")
                {
                    return("You at least have a name!");
                }
                return("");
            };

            if (InputBoxVal.Show("What are you called?", "Name:", ref playerName, validation) == DialogResult.OK)
            {
                return(playerName);
            }
            return(playerName);
        }