Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (simulationManager.initialSeekAlgorithmDone)
     {
         //If the victim is NOT saved
         if (!isSaved)
         {
             timer += Time.deltaTime;
             if (timer > simulationStep)
             {
                 timer = 0;
                 currentStep++;
             }
             if (currentStep >= survivalTime && isAlive)
             {
                 isAlive = false;
                 //TODO: ADD TO HEAP FOR VICTIM DEATH
                 EventScript es = new EventScript(currentStep, " VictimDeath ", this.name, " - ", " - ");
                 simulationManager.addEvent(es);
                 EventScriptVictim esv = new EventScriptVictim(this.name, (int)position.x, (int)position.y, survivalTime, false, 0, " ", 0);
                 simulationManager.addEventVictim(esv);
                 //Destroy(this.gameObject);
                 GameObject X = Instantiate(victimDeadX, this.transform.position, Quaternion.identity);
                 X.transform.parent = this.transform;
             }
         }
         else if (madeSavedEvent == false)
         {
             madeSavedEvent = true;
             EventScriptVictim es = new EventScriptVictim(this.name, (int)position.x, (int)position.y, survivalTime, true, timeRescued, ambulanceToPickUpVictim.name, currentStep);
             simulationManager.addEventVictim(es);
             //EventScript es = new EventScriptVictim(name, LocationInfo, survivalTime, ifSaved, timeRescued, ambulanceThatUnloaded, "unloaded at", time);
         }
     }
 }
 public int CompareTo(EventScriptVictim other)
 {
     return(this.victimName.CompareTo(other.victimName));
 }