示例#1
0
    void EndGame()
    {
        Debug.Log("invoked end game");
        Restart restart = new Restart();

        GameEvents.GameEventManager.post(restart);
    }
示例#2
0
 public void IncMus()
 {
     Debug.Log("PlaySongICNkrhqqojkf");
     Direct.selflink.IncMusic();
     Voice.self.InitMic();
     Restart.RestartGame();
 }
示例#3
0
    public void Gameover()
    {
        Gameovertext.SetActive(true);
        Restart.SetActive(true);

        ball.SetActive(false);
    }
示例#4
0
    public IEnumerator Timer(string act)
    {
        fon_timer.gameObject.SetActive(true);
        GetComponent <RayCast>().Some[3].SetActive(false);


        int i = 3;

        while (i > 0)
        {
            fon_timer.GetComponentInChildren <Text>().text = i + "";
            yield return(new WaitForSeconds(1f));

            i--;
        }
        fon_timer.gameObject.SetActive(false);
        if (act == "restart")
        {
            Restart.RestartGame();
        }
        if (act == "next_level")
        {
            MelodyPlayer.self.IncMus();
        }
        if (postAct != null)
        {
            postAct();
        }
    }
示例#5
0
 // Update is called once per frame
 void Update()
 {
     if (SceneController.currentScene == "Prelude")
     {
         if (SceneController.currentScene == "Prelude" && startTimer > 0f)
         {
             startTimer -= Time.deltaTime;
         }
         if (SceneController.currentScene == "Prelude" && startTimer <= 0f && startEndTimer == false && textShown == false)
         {
             ShowText();
         }
         if (theTextBox.currentLine == 14 && startEndTimer == false)
         {
             startEndTimer = true;
         }
         if (startEndTimer)
         {
             endTimer -= Time.deltaTime;
         }
         if (SceneController.currentScene == "Prelude" && endTimer <= 0f)
         {
             Restart r = obj.AddComponent <Restart>();
             r.RestartGame();
             sceneController = GameObject.FindGameObjectWithTag("GameController").GetComponent <SceneController>();
             sceneController.LoadScene("Starting_area");
         }
     }
 }
示例#6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="action"></param>
 /// <param name="display"></param>
 /// <param name="restart"></param>
 /// <param name="commandLine"></param>
 /// <param name="cmdShow"></param>
 /// <param name="resume"></param>
 /// <param name="splashScreen"></param>
 /// <param name="relation"></param>
 /// <param name="passthrough"></param>
 /// <param name="layoutDirectory"></param>
 /// <param name="bootstrapperWorkingFolder"></param>
 /// <param name="bootstrapperApplicationDataPath"></param>
 public BootstrapperCommand(
     LaunchAction action,
     Display display,
     Restart restart,
     string commandLine,
     int cmdShow,
     ResumeType resume,
     IntPtr splashScreen,
     RelationType relation,
     bool passthrough,
     string layoutDirectory,
     string bootstrapperWorkingFolder,
     string bootstrapperApplicationDataPath)
 {
     this.Action                          = action;
     this.Display                         = display;
     this.Restart                         = restart;
     this.commandLine                     = commandLine;
     this.CmdShow                         = cmdShow;
     this.Resume                          = resume;
     this.SplashScreen                    = splashScreen;
     this.Relation                        = relation;
     this.Passthrough                     = passthrough;
     this.LayoutDirectory                 = layoutDirectory;
     this.BootstrapperWorkingFolder       = bootstrapperWorkingFolder;
     this.BootstrapperApplicationDataPath = bootstrapperApplicationDataPath;
 }
        public void RestartApplication()
        {
            string Restart;

            {
                Console.WriteLine("To restart calculator press 'y' OR press 'n' to exit");

                Restart = Console.ReadLine().ToLower();

                if (!Restart.Equals("y") && !Restart.Equals("n"))
                {
                    Console.WriteLine("Invalid!");
                    RestartApplication();
                }
                else if (Restart.Equals("y"))
                {
                    Console.Clear();
                    RunCalculator();
                }
                else
                {
                    Restart.Equals("n");
                }
                {
                    Environment.Exit(0);
                }
            }
        }
示例#8
0
    public void OnRestartClicked()
    {
        var goodToGo = true;

        if (elevatorsAmount < 1 || elevatorsAmount > MAX_ELEVATORS)
        {
            Debug.LogError($"elevators amount should be 1 .. {MAX_ELEVATORS}");
            goodToGo = false;
        }

        if (floorsAmount < 1 || floorsAmount > MAX_FLOORS)
        {
            Debug.LogError($"floors amount should be 1 .. {MAX_FLOORS}");
            goodToGo = false;
        }

        if (!goodToGo)
        {
            return;
        }

        Restart.Invoke();

        basement.Restart(elevatorsAmount, floorsAmount);
        isPlaying = true;

        Pause(false);
    }
示例#9
0
    public void Init()
    {
        instance = this;

        //

        enterGame = Log;

        goPlay += GameManager.instance.charManager.move.Check;
        goPlay += delegate { GameManager.instance.itemManager.isPlaying = true; };
        goPlay += delegate { AudioManager.Instance.PlaySound(AudioManager.AudioName.StartGame, 0.9F); };

        restart += GameManager.instance.Reload;

        moveView += GameManager.instance.charManager.View;

        buyItem += GameManager.instance.itemManager.buyItem;

        setItemInCell += GameManager.instance.itemManager.setItemInCell_World;
        setItemInCell += delegate { AudioManager.Instance.PlaySound(AudioManager.AudioName.ItemDrop, 0.8F); };
        //setItemInCell += LogCellPos;

        lose += delegate { AudioManager.Instance.PlaySound(AudioManager.AudioName.GameOver, 0.8F); };

        win += delegate { AudioManager.Instance.PlaySound(AudioManager.AudioName.LevelClear1, 0.8F); };
        win += delegate { AudioManager.Instance.PlaySound(AudioManager.AudioName.LevelClear2, 0.8F); };
    }
示例#10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile   = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage        = new Pages(intProfile, dsn);
     oRequestItem = new RequestItems(intProfile, dsn);
     oRestart     = new Restart(intProfile, dsn);
     oRequest     = new Requests(intProfile, dsn);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
     {
         if (!IsPostBack)
         {
             LoadLists();
         }
         btnNext.Attributes.Add("onclick", "return ValidateDropDown('" + ddlDevice.ClientID + "','Please select a device')" +
                                ";");
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
 }
示例#11
0
        private void MyThread()
        {
            BattleField Battle = BattleField.getBat();

            Battle.DelR();
            int i = Battle.DoMany(ArmyA, ArmyB);

            if (i == 1 || i == 2)
            {
                if (i == 1)
                {
                    string s = Battle.WhoWin() + " выиграли!";
                    Battle.NotifyObserverF(s);

                    MessageBox.Show(s, "Win!", MessageBoxButtons.OK);
                }
                else
                {
                    MessageBox.Show("Ничья.", "GameOver!", MessageBoxButtons.OK);
                    Battle.NotifyObserverF("Ничья.");
                }
                Restart.Invoke(new Action(() => Restart.Enabled     = true));
                UnDo.Invoke(new Action(() => UnDo.Enabled           = false));
                ReDo.Invoke(new Action(() => ReDo.Enabled           = false));
                OneStep.Invoke(new Action(() => OneStep.Enabled     = false));
                Start.Invoke(new Action(() => Start.Enabled         = false));
                Pause.Invoke(new Action(() => Pause.Enabled         = false));
                groupBox2.Invoke(new Action(() => groupBox2.Enabled = true));

                groupBox1.Invoke(new Action(() => groupBox1.Enabled = true));
            }
        }
示例#12
0
    public static Vector2Int nextPlayerPositionOnTile;    // 2.次の位置を取得


    private void Start()
    {
        gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();
        stage       = GameObject.Find("StageManager").GetComponent <StageManager>();
        rs          = GameObject.Find("Goal(Clone)").GetComponent <Restart>();
        hasMochi    = false;
    }
示例#13
0
    public void DisableTextBox()
    {
        theText.text = " ";

        textBox.SetActive(false);
        isActive = false;
        npc      = null;

        if (Portal.hasAllCrystals == true)
        {
            Restart r = FindObjectOfType <Restart>();
            r.Win();
            Player.instance.OnRunSpeed();
            Player.instance.UnMuteWalk();
            return;
        }
        else if (ship)
        {
            Restart r = FindObjectOfType <Restart>();
            r.Win();
            Player.instance.OnRunSpeed();
            Player.instance.UnMuteWalk();
            return;
        }

        Player.instance.OnRunSpeed();
        Player.instance.UnMuteWalk();

        player.canMove = true;
    }
示例#14
0
    private IEnumerator RestartMusic()
    {
        UnityWebRequest webRequest = new UnityWebRequest("https://api-b2b.mubert.com/v2/Restart", "POST");
        Method          au         = new Method();

        au.method    = "Restart";
        au.param.pat = pat;
        string json = JsonUtility.ToJson(au);

        json = json.Replace("\"param\":{", "\"params\":{");
        Debug.Log(json);
        byte[] encodedPayload = new System.Text.UTF8Encoding().GetBytes(json);
        webRequest.uploadHandler   = (UploadHandler) new UploadHandlerRaw(encodedPayload);
        webRequest.downloadHandler = (DownloadHandler) new DownloadHandlerBuffer();
        webRequest.SetRequestHeader("Content-Type", "application/json");
        webRequest.SetRequestHeader("cache-control", "no-cache");

        UnityWebRequestAsyncOperation requestHandel = webRequest.SendWebRequest();
        int time = 0;

        requestHandel.completed += delegate(AsyncOperation pOperation)
        {
            Debug.Log(webRequest.responseCode);
            Debug.Log(webRequest.downloadHandler.text);
            if (webRequest.downloadHandler.text.Contains("Will be restarted"))
            {
                Restart responce = JsonUtility.FromJson <Restart>(webRequest.downloadHandler.text);

                debug.text = responce.data.text + " in 5 sec";
                StartCoroutine(ClearDebug(5));
            }
            //{"method":"Restart","status":1,"data":{"code":1,"text":"Will be restarted","time":31},"api_ver":"api-b2b_2.1"}
        };
        yield return(null);
    }
示例#15
0
        public MainForm()
        {
            InitializeComponent();
            mc                = new MinecraftHandler("rules.txt", "kits.xml", "banned-players.txt", "player.txt", "admins.txt", "MineCraftAdmin.cfg");
            Tunnel            = new TcpTunnelServer(mc);
            mc.ServerStarted += new EventHandler(mc_ServerStarted);
            mc.ServerStopped += new EventHandler(mc_ServerStopped);

            mc.PlayerJoined += new MinecraftHandler.OnPlayerjoined(mc_PlayerJoined);
            mc.PlayerLeft   += new MinecraftHandler.OnPlayerLeft(mc_PlayerLeft);

            mc.OutputDataReceived += new MinecraftHandler.OnOutputDataReceived(mc_OutputDataReceived);
            mc.ServerExited       += new MinecraftHandler.OnServerExited(mc_ServerExited);
            LoadModules();
            ReadFromConfig();
            //CheckIfRestartOrBackup();
            this.Text  = "Zicore's Minecraft Admintool - © 2010-2011 - v" + Application.ProductVersion;
            mc.Version = Application.ProductVersion;
            restart    = new Restart(mc);

            this.listLoadedPlugins.DataSource = mc.Plugins;
            //mc.SaveCompleted += new MinecraftHandler.OnSaveCompletedDelegate(mc_SaveCompleted);
            web = new WebHandler(mc, Tunnel);
            web.Start();
            GenerateTaskColumns();
        }
示例#16
0
 private void DragonDie()
 {
     DiedLabel.Visible = true;
     DiedLabel.BringToFront();
     Restart.Visible = true;
     Restart.BringToFront();
 }
示例#17
0
    //private int jumpCount = 0;

    //private bool isGrounded = false;

    // Use this for initialization
    void Start()
    {
        player = GetComponent <Rigidbody2D>();
        score  = FindObjectOfType <Score>();
        start  = FindObjectOfType <Restart>();
        anim   = GetComponent <Animator>();
        anim.SetBool("isJump", false);
    }
    //Put the buttons in inactive mode and give a referance to Rigidbody2D.
    void Start()
    {
        gameOver.SetActive(false);
        Restart.SetActive(false);
        Exit.SetActive(false);

        rb2d = GetComponent <Rigidbody2D>();
    }
示例#19
0
 // Use this for initialization
 void Awake()
 {
     spriteRenderer = GetComponent <SpriteRenderer>();
     animator       = GetComponent <Animator>();
     trigger        = GetComponent <TriggerHandler>();
     restart        = GetComponent <Restart>();
     coll           = gameObject.GetComponent <CapsuleCollider2D>();
 }
示例#20
0
        public async Task API_RestartTest()
        {
            var widget  = new TestWidget();
            var handler = new Restart();
            var request = RestartRequest.Create(widget);

            await handler.Handle(request, CancellationToken.None);
        }
示例#21
0
        // Module defining this command


        // Optional custom code for this activity


        /// <summary>
        /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
        /// </summary>
        /// <param name="context">The NativeActivityContext for the currently running activity.</param>
        /// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
        /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
        protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context)
        {
            System.Management.Automation.PowerShell invoker       = global::System.Management.Automation.PowerShell.Create();
            System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);

            // Initialize the arguments

            if (PassThru.Expression != null)
            {
                targetCommand.AddParameter("PassThru", PassThru.Get(context));
            }

            if (DomainCredential.Expression != null)
            {
                targetCommand.AddParameter("DomainCredential", DomainCredential.Get(context));
            }

            if (LocalCredential.Expression != null)
            {
                targetCommand.AddParameter("LocalCredential", LocalCredential.Get(context));
            }

            if (NewName.Expression != null)
            {
                targetCommand.AddParameter("NewName", NewName.Get(context));
            }

            if (Force.Expression != null)
            {
                targetCommand.AddParameter("Force", Force.Get(context));
            }

            if (Restart.Expression != null)
            {
                targetCommand.AddParameter("Restart", Restart.Get(context));
            }

            if (WsmanAuthentication.Expression != null)
            {
                targetCommand.AddParameter("WsmanAuthentication", WsmanAuthentication.Get(context));
            }

            if (Protocol.Expression != null)
            {
                targetCommand.AddParameter("Protocol", Protocol.Get(context));
            }

            if (GetIsComputerNameSpecified(context) && (PSRemotingBehavior.Get(context) == RemotingBehavior.Custom))
            {
                targetCommand.AddParameter("ComputerName", PSComputerName.Get(context));
            }


            return(new ActivityImplementationContext()
            {
                PowerShellInstance = invoker
            });
        }
示例#22
0
        public void Post(Restart request)
        {
            if (!ZeroUsersOrIsAdmin())
            {
                return;
            }

            AppLifetime?.StopApplication();
        }
示例#23
0
 public CarGame()
 {
     InitializeComponent();
     Wall1.BringToFront();
     Wall2.BringToFront();
     Wall3.BringToFront();
     Restart.BringToFront();
     Exist.BringToFront();
 }
示例#24
0
 void Start()
 {
     _ARTrackedImage = GetComponent <ARTrackedImage>();
     //CheckName(_ARTrackedImage.referenceImage.name);
     itemCheckerObject = GameObject.Find("ItemChecker");
     itemChecker       = itemCheckerObject.GetComponent <ItemChecker>();
     itemRestart       = itemCheckerObject.GetComponent <Restart>();
     CheckNamesOfItems();
 }
示例#25
0
 // Check for contact between objects and therefore activate the buttons if there is a contact.
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag.Equals("Asteroid"))
     {
         gameOver.SetActive(true);
         Restart.SetActive(true);
         Exit.SetActive(true);
     }
 }
示例#26
0
        public When_creating_a_restart_command_with_a_negative_delay()
        {
            var fixture = new Fixture()
                          .CustomizeConnectedProjectionIdentifiers();

            _sut = new Restart(
                fixture.Create <ConnectedProjectionIdentifier>(),
                TimeSpan.FromSeconds(fixture.CreateNegative <int>()));
        }
示例#27
0
 public ShootingGame()
 {
     InitializeComponent();
     EnemyJet1.BringToFront();
     EnemyJet2.BringToFront();
     EnemyJet3.BringToFront();
     Restart.BringToFront();
     Exist.BringToFront();
     MainJet.BringToFront();
 }
        public void AddsCorrectly()
        {
            var instruction  = new Restart();
            var instructions = new SceneInstructions();

            instructions.Add(instruction);
            var result = Assert.Single(instructions.Instructions);

            Assert.Equal(instruction, result);
        }
示例#29
0
    private void Awake()
    {
        if (Instance)
        {
            DestroyImmediate(gameObject);
            return;
        }

        Instance = this;
    }
 private void buttonContinue_Click(object sender, EventArgs e)
 {
     if (_exitApplicationIfClose)
     {
         Restart.LaunchRestarter();
     }
     else
     {
         Close();
     }
 }
        /// <summary>
        /// Factory method for creating commands
        /// </summary>
        /// <param name="inputCommand">User input string</param>
        /// <returns>ICommand object</returns>
        public ICommand CreateCommand(string inputCommand)
        {
            inputCommand = inputCommand.ToLower();
            if (this.commandDictionary.ContainsKey(inputCommand))
            {
                return this.commandDictionary[inputCommand];
            }
            else
            {
                ICommand command;

                switch (inputCommand)
                {
                    case "help":
                        command = new Help();
                        break;
                    case "top":
                        command = new Top();
                        break;
                    case "restart":
                        command = new Restart();
                        break;
                    case "exit":
                        command = new Exit();
                        break;
                    default:
                        if (inputCommand.Length != 1 || string.IsNullOrWhiteSpace(inputCommand))
                        {
                            throw new ArgumentException(GlobalMessages.IncorrectGuessOrCommand);
                        }

                        command = new LetterGuess(inputCommand);
                        break;
                }

                return command;
            }
        }
示例#32
0
 //This section still needs some serious development
 void irc_restart()
 {
     /*
     DateTime now = DateTime.Now;
     if (now.CompareTo(lastRestart.AddMinutes(1)) > 0)
     {
         restartCounter = 0;
         irc_stuffHappened(String.Format("Restart attempt {0}.", restartCounter + 1));
     }
     else
     {
         restartCounter++;
         irc_stuffHappened(String.Format("Restart attempt {0}.", restartCounter + 1));
     }
     lastRestart = now;
     if (restartCounter < 10)
     {
         irc.connect();
         try
             {
                 irc.write("!QUIT :Attempting to restart connection");
             }
         catch (ObjectDisposedException) { }
         catch (System.IO.IOException) { }
     }
     else
     {
         irc_stuffHappened(String.Format("Disconnection process aborted after {0} attempts.",restartCounter));
         button1.Visible = true;
     }*/
     if (this.button1.InvokeRequired)
     {
         // It's on a different thread, so use Invoke.
         Restart d = new Restart(reconnectButton);
         this.Invoke(d);
     }
     else { this.reconnectButton(); }
 }
示例#33
0
 void EndGame()
 {
     Debug.Log ("invoked end game");
     Restart restart = new Restart ();
     GameEvents.GameEventManager.post (restart);
 }