Пример #1
0
        public override Func0 addCameraPhotoEventListener(Func5 cb)
        {
            string cbId = Guid.NewGuid().ToString();

            camera_callbacks[cbId] = cb;

            return(() => { camera_callbacks.Remove(cbId); return null; });
        }
Пример #2
0
 public Func5PipeFunction(Func5 fn)
 {
     this.fn = fn;
 }
Пример #3
0
 /// <summary>
 /// Creates a pipe function that takes five arguments from pipe.
 /// </summary>
 /// <param name="fn">A delegate that encapsulates a method that match the signature of <see cref="Func5"/>.</param>
 /// <returns>The constructed pipe function that can be invoked with a given pipe context.</returns>
 public static PipeFunction Create(Func5 fn)
 {
     CommonHelper.ConfirmNotNull(fn, "fn");
     return(new Func5PipeFunction(fn));
 }
Пример #4
0
 public virtual Func0 addGestureListener(String name, Func5 cb)
 {
     return(null);
 }
Пример #5
0
 public virtual Func0 addCameraPhotoEventListener(Func5 cb)
 {
     return(no_op);
 }
Пример #6
0
    // The program part of the Main Menu
    // Directs players to other parts of the program

    public static void MenuProg()
    {
        string rawInput = "TBC";
        char   input    = '0';
        bool   check    = false;

        GameDraw();



        // Checks if player input is valid
        while (!check)
        {
            Console.Write("\nYour Input: ");

            rawInput = Console.ReadLine();
            try{
                input = Convert.ToChar(rawInput);
                if (input >= 49 && input <= 56)
                {
                    check = true;
                }
                else
                {
                    GameDraw();
                    Console.WriteLine("\nError: '{0}' is not a valid input", rawInput);
                }
            }
            catch {
                if (rawInput == "")
                {
                    check = true;
                }
                else
                {
                    GameDraw();
                    Console.WriteLine("\nError: '{0}' is not a valid input", rawInput);
                }
            }
        }

        // Directs player to corresponding menu
        switch (input)
        {
        case '1':
            Func1.CovidAnnProg(Global.covidAnnPurch);
            break;

        case '2':
            Func2.HealthProg();
            break;

        case '3':
            Func3.VaccineProg();
            break;

        case '4':
            Func4.BorderProg();
            break;

        case '5':
            Func5.DefenceProg();
            break;

        case '6':
            Func6.EducationProg();
            break;

        case '7':
            Intro(true);
            break;

        case '8':
            Help();
            break;

        default:
            // Initiates all inputs and simulates Covid-19
            Game.Submit();
            break;
        }
    }