RoomManager.Update C# (CSharp) Méthode

Update() public méthode

public Update ( ) : void
Résultat void
    void Update()
    {
        // spawn enemies
        if (!startScreen) {
            timer++;
            if (timer % this.enemySpawnInterval == 0) {
                int randomRegionIndex = (int) Math.Sqrt(Random.Range(0, this.regions.Count * this.regions.Count));
                this.regions[randomRegionIndex].spawnEnemy();
            }
        }
    }

Usage Example

Exemple #1
0
 public IActionResult Edit(int id, Room room)
 {
     if (id != room.Id)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         room.Action     = Actions.ActionUpdate;
         room.ActionDate = DateTime.Now.ToString("F");
         room.ActionBy   = "Me";
         room.IsDelete   = 0;
         string updated = roomManager.Update(room);
         ViewData["Message"] = updated;
         ModelState.Clear();
         if (updated.Equals("1"))
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             ViewData["Message"] = updated;
             return(View(room));
         }
     }
     else
     {
         ViewData["Message"] = Message.Warning("Fill up all fields correctly");
         //get by id
         Room roomModel = roomManager.GetById(room.Id);
         return(View(roomModel));
     }
 }
All Usage Examples Of RoomManager::Update