Exemple #1
0
    private void Awake()
    {
        zoneGame = cookingGame.GetComponent <ZoneGame>();
        cookingGame.SetActive(false);
        ingredientMenu.SetActive(false);

        if (CM == null)
        {
            CM = this;
        }
        else
        {
            Destroy(this.gameObject);
        }
    }
        public async Task <IActionResult> Edit(int id, [Bind("Id,ArenaId,GameCategoryId,GameStatusId,GameTypeId,ZoneId,TSMNumberZone1,ClubId,ClubId1,PersonId,ZoneId1,TSMNumberZone2,ClubId2,ClubId3,PersonId1,PersonId2,ZoneGameDateTime,ZoneGameName")] ZoneGame zoneGame)
        {
            if (id != zoneGame.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(zoneGame);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ZoneGameExists(zoneGame.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(ListZoneGames)));
            }
            ViewData["ArenaId"]        = new SelectList(_context.Arena, "Id", "ArenaName", zoneGame.ArenaId);
            ViewData["ClubId1"]        = new SelectList(_context.Club, "Id", "ClubName", zoneGame.ClubId1);
            ViewData["ClubId3"]        = new SelectList(_context.Club, "Id", "ClubName", zoneGame.ClubId3);
            ViewData["GameCategoryId"] = new SelectList(_context.GameCategory, "Id", "GameCategoryName", zoneGame.GameCategoryId);
            ViewData["GameStatusId"]   = new SelectList(_context.GameStatus, "Id", "GameStatusName", zoneGame.GameStatusId);
            ViewData["GameTypeId"]     = new SelectList(_context.GameType, "Id", "GameTypeName", zoneGame.GameTypeId);
            ViewData["ClubId"]         = new SelectList(_context.Club, "Id", "ClubName", zoneGame.ClubId);
            ViewData["ClubId2"]        = new SelectList(_context.Club, "Id", "ClubName", zoneGame.ClubId2);
            ViewData["PersonId2"]      = new SelectList(_context.Person, "Id", "FullName", zoneGame.PersonId2);
            ViewData["PersonId"]       = new SelectList(_context.Person, "Id", "FullName", zoneGame.PersonId);
            ViewData["PersonId1"]      = new SelectList(_context.Person, "Id", "FullName", zoneGame.PersonId1);
            ViewData["ZoneId"]         = new SelectList(_context.Zone, "Id", "ZoneName", zoneGame.ZoneId);
            ViewData["ZoneId1"]        = new SelectList(_context.Zone, "Id", "ZoneName", zoneGame.ZoneId1);
            return(View(zoneGame));
        }
        public async Task <IActionResult> Create([Bind("Id,ArenaId,GameCategoryId,GameStatusId,GameTypeId,ZoneId,TSMNumberZone1,ClubId,ClubId1,PersonId,ZoneId1,TSMNumberZone2,ClubId2,ClubId3,PersonId1,PersonId2,ZoneGameDateTime,ZoneGameName")] ZoneGame zoneGame)
        {
            if (ModelState.IsValid)
            {
                _context.Add(zoneGame);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(ListZoneGames)));
            }
            ViewData["ArenaId"]        = new SelectList(_context.Arena, "Id", "ArenaName", zoneGame.ArenaId);
            ViewData["ClubId1"]        = new SelectList(_context.Club, "Id", "ClubName", zoneGame.ClubId1);
            ViewData["ClubId3"]        = new SelectList(_context.Club, "Id", "ClubName", zoneGame.ClubId3);
            ViewData["GameCategoryId"] = new SelectList(_context.GameCategory, "Id", "GameCategoryName", zoneGame.GameCategoryId);
            ViewData["GameStatusId"]   = new SelectList(_context.GameStatus, "Id", "GameStatusName", zoneGame.GameStatusId);
            ViewData["GameTypeId"]     = new SelectList(_context.GameType, "Id", "GameTypeName", zoneGame.GameTypeId);
            ViewData["ClubId"]         = new SelectList(_context.Club, "Id", "ClubName", zoneGame.ClubId);
            ViewData["ClubId2"]        = new SelectList(_context.Club, "Id", "ClubName", zoneGame.ClubId2);
            ViewData["PersonId2"]      = new SelectList(_context.Person, "Id", "FullName", zoneGame.PersonId2);
            ViewData["PersonId"]       = new SelectList(_context.Person, "Id", "FullName", zoneGame.PersonId);
            ViewData["PersonId1"]      = new SelectList(_context.Person, "Id", "FullName", zoneGame.PersonId1);
            ViewData["ZoneId"]         = new SelectList(_context.Zone, "Id", "ZoneName", zoneGame.ZoneId);
            ViewData["ZoneId1"]        = new SelectList(_context.Zone, "Id", "ZoneName", zoneGame.ZoneId1);
            return(View(zoneGame));
        }
 /*
  * This script only runs when on an enabled object. It checks every frame to see if the cooking game is complete.
  *  if it is complete, then tell the manager it is done.
  */
 private void Awake()
 {
     theGame = GetComponent <ZoneGame>();
 }