Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,StartDate,EndDate," +
                                                             "SpecialEvents,SpecialShabassos,Months,Parshios,StartTime,EndTime,EventDescription")] YearlyEvents yearlyEvents)
        {
            if (id != yearlyEvents.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(yearlyEvents);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!YearlyEventsExists(yearlyEvents.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(yearlyEvents));
        }
Ejemplo n.º 2
0
        public static void StartEvent(YearlyEvents yearlyEvent)
        {
            switch (yearlyEvent)
            {
            case YearlyEvents.AdvanceTime:
                AdvanceTime();
                break;

            case YearlyEvents.NewYear:
                YearlyNewYear();
                break;

            case YearlyEvents.Spring:
                YearlySpring();
                break;

            case YearlyEvents.MidSummer:
                YearlyMidSummer();
                break;

            case YearlyEvents.Harvest:
                YearlyHarvest();
                break;

            case YearlyEvents.Christmas:
                YearlyChristmas();
                break;
            }
        }
Ejemplo n.º 3
0
 void Start()
 {
     gameManager  = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();
     yearlyEvents = GameObject.FindGameObjectWithTag("GameManager").GetComponent <YearlyEvents>();
     cameraMove   = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraMove>();
     statsUI      = GetComponent <StatsUI>();
     resourceUI   = GetComponent <ResourceUI>();
 }
Ejemplo n.º 4
0
        public async Task <IActionResult> Create
            ([Bind("Id,StartingDate,EndingDate,SpecialEvents,SpecialShabassos," +
                   "Months,Parshios,StartTime,EndTime,LifeEvents,EventDescription")] YearlyEvents yearlyEvents)
        {
            if (ModelState.IsValid)

            {
                _context.Add(yearlyEvents);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(yearlyEvents));
        }