public void NumberLower()
 {
     gameLogic.AdaptMax();
     nbrText.text = gameLogic.GetGuess();
 }
Exemple #2
0
    //Implement new commands in this region of the file.

    void game(string[] args)
    {
        string msg = "";

        if (args.Length == 0)
        {
            msg = "game [start] -- starts the game in default mode (min=1, max=1000 \n" +
                  "game [start] [min] [max] -- starts the game in user specified mode \n" +
                  "game [lower] -- use if your number is lower than the guess \n" +
                  "game [higher] -- use if your number is higher than the guess \n " +
                  "game [end] -- use if your number equals the guess";
        }
        else if (args.Length == 1)
        {
            if (args[0].Equals("end"))
            {
                gameLogic.EndGame();
                msg = "Erraten :)";

                MyDebug("console End");
            }
            else if (args[0].Equals("start"))
            {
                msg = gameLogic.StartGame();

                MyDebug("console Start");
            }

            else if (args[0].Equals("lower"))
            {
                gameLogic.AdaptMax();
                msg = gameLogic.NextGuess();

                MyDebug("console Lower");
            }
            else if (args[0].Equals("higher"))
            {
                gameLogic.AdaptMin();
                msg = gameLogic.NextGuess();

                MyDebug("console Higher");
            }
            else
            {
                msg = "richtiger Befehl? Tippe game für Hilfe";
            }
        }
        else if (args.Length == 3)
        {
            gameLogic.SetValues(Int32.Parse(args[1]), Int32.Parse(args[2]));
            MyDebug("args: [0]" + args[0] + " [1]" + args[1] + " [2] " + args[2]);

            msg = gameLogic.StartGame();
        }
        else
        {
            msg = "Ein Satz mit X das war wohl nix! Befehl richtig?";
        }

        appendLogLine(msg);
    }