// GET: EventGames/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EventGame eventGame = await db.EventGames.FindAsync(id);

            if (eventGame == null)
            {
                return(HttpNotFound());
            }
            return(View(eventGame));
        }
        // GET: EventGames/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EventGame eventGame = await db.EventGames.FindAsync(id);

            if (eventGame == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EventID = new SelectList(db.Events, "ID", "EventName", eventGame.EventID);
            ViewBag.GameID  = new SelectList(db.Games, "ID", "Name", eventGame.GameID);
            return(View(eventGame));
        }
Exemplo n.º 3
0
 private void ClientServices_GetEventGameCompleted(object sender, GetEventGameCompletedEventArgs e)
 {
     if(e.Error == null)
     {
         if(e.Result != null)
         {
             currentEvent = e.Result;
             isEventFound = true;
         }
         else
         {
             Debug.Log("No event found");
         }
     }
     else
     {
         Debug.LogError("Get event Error " + e.Error.Message);
     }
 }
Exemplo n.º 4
0
    IEnumerator projectileCoroutine(EventGame eg)
    {
        Scene      m_Scene = SceneManager.GetActiveScene();
        GameObject currentProjectilePrefab;

        if (m_Scene.name == "LevelPlaine")
        {
            currentProjectilePrefab = projectilePlaine;
        }
        else
        {
            currentProjectilePrefab = projectileIce;
        }
        int i     = 180;
        int compt = 0;

        while (isGameStarting)
        {
            if (difficulty == "LOW")
            {
                yield return(new WaitForSeconds(1));
            }
            else if (difficulty == "MEDIUM")
            {
                yield return(new WaitForSeconds(0.5f));
            }
            else if (difficulty == "HARD")
            {
                yield return(new WaitForSeconds(0.25f));
            }
            else
            {
                yield return(new WaitForSeconds(0.25f));
            }

            GameObject currentSpawner    = spawnerProjectile[eg.spawnOrderProjectile[compt]];
            GameObject currentProjectile = Instantiate(currentProjectilePrefab, currentSpawner.transform.position, currentSpawner.transform.rotation) as GameObject;
            Destroy(currentProjectile, 10);
            compt++;
        }
    }
Exemplo n.º 5
0
    IEnumerator apocalypseCoroutine(EventGame eg)
    {
        int i = 0;

        GameObject[] instancesFXShield = new GameObject[eg.spawnApocalypseInformations.Count];
        mainCamera.GetComponent <AudioSource>().PlayOneShot(apocalypseCooldownClip);
        while (i < eg.spawnApocalypseInformations.Count)
        {
            GameObject instanceFXShield = Instantiate(FXShield, eg.spawnApocalypseInformations[i].position, Quaternion.identity) as GameObject;
            instancesFXShield[i] = instanceFXShield;

            i++;
        }
        Material mGround   = ground.GetComponent <MeshRenderer>().material;
        Color    initColor = mGround.color;
        float    compt     = 0;

        while (compt < 5)
        {
            mGround.color = Color.Lerp(initColor, Color.red, compt / 5);
            yield return(new WaitForEndOfFrame());

            compt += Time.deltaTime;
        }
        mGround.color = initColor;
        CameraShake();
        if (localPlayer.GetComponent <PlayControllerJoystick>().isSafe == 0)
        {
            localPlayer.GetComponent <DeathPlayer>().Death();
        }
        yield return(new WaitForSeconds(2.0f));

        i = 0;
        localPlayer.GetComponent <PlayControllerJoystick>().isSafe = 0;
        while (i < eg.spawnApocalypseInformations.Count)
        {
            Destroy(instancesFXShield[i]);
            i++;
        }
    }
Exemplo n.º 6
0
    ///////////////////////////////
    ///////// Form Events /////////
    ///////////////////////////////

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            bool blnHasAccess = clsSystemModule.HasAccess(clsSystemModule.ModuleSynergy, Request.Cookies["Speedo"]["Username"]);

            hdnGameID.Value = Request.QueryString["gameid"];

            ddlStartMonth.DataSource     = clsDateTime.GetMonths();
            ddlStartMonth.DataValueField = "pvalue";
            ddlStartMonth.DataTextField  = "ptext";
            ddlStartMonth.DataBind();
            ddlStartDay.DataSource     = clsDateTime.GetDays();
            ddlStartDay.DataValueField = "pvalue";
            ddlStartDay.DataTextField  = "ptext";
            ddlStartDay.DataBind();
            ddlStartHour.DataSource     = clsDateTime.GetHours();
            ddlStartHour.DataValueField = "pvalue";
            ddlStartHour.DataTextField  = "ptext";
            ddlStartHour.DataBind();
            ddlStartMinute.DataSource     = clsDateTime.GetMinutes();
            ddlStartMinute.DataValueField = "pvalue";
            ddlStartMinute.DataTextField  = "ptext";
            ddlStartMinute.DataBind();
            ddlStartTimePeriod.DataSource     = clsDateTime.GetTimePeriod();
            ddlStartTimePeriod.DataValueField = "pvalue";
            ddlStartTimePeriod.DataTextField  = "ptext";
            ddlStartTimePeriod.DataBind();

            ddlEndMonth.DataSource     = clsDateTime.GetMonths();
            ddlEndMonth.DataValueField = "pvalue";
            ddlEndMonth.DataTextField  = "ptext";
            ddlEndMonth.DataBind();
            ddlEndDay.DataSource     = clsDateTime.GetDays();
            ddlEndDay.DataValueField = "pvalue";
            ddlEndDay.DataTextField  = "ptext";
            ddlEndDay.DataBind();
            ddlEndHour.DataSource     = clsDateTime.GetHours();
            ddlEndHour.DataValueField = "pvalue";
            ddlEndHour.DataTextField  = "ptext";
            ddlEndHour.DataBind();
            ddlEndMinute.DataSource     = clsDateTime.GetMinutes();
            ddlEndMinute.DataValueField = "pvalue";
            ddlEndMinute.DataTextField  = "ptext";
            ddlEndMinute.DataBind();
            ddlEndTimePeriod.DataSource     = clsDateTime.GetTimePeriod();
            ddlEndTimePeriod.DataValueField = "pvalue";
            ddlEndTimePeriod.DataTextField  = "ptext";
            ddlEndTimePeriod.DataBind();

            ddlWinner.DataSource     = DALPortal.DSLTeamNA();
            ddlWinner.DataValueField = "TeamID";
            ddlWinner.DataTextField  = "TeamName";
            ddlWinner.DataBind();

            ddlGamePhase.DataSource     = DALPortal.DSLGamePhase();
            ddlGamePhase.DataValueField = "pvalue";
            ddlGamePhase.DataTextField  = "ptext";
            ddlGamePhase.DataBind();

            using (PortalDataContext pdc = new PortalDataContext())
            {
                EventGame eventGame = (from eg in pdc.EventGames
                                       where eg.GameID == hdnGameID.Value.ToInt()
                                       select eg).SingleOrDefault();

                hdnEventID.Value                 = eventGame.EventID.ToString();
                txtEvent.Text                    = DALPortal.GetEventName(eventGame.EventID);
                ddlGamePhase.SelectedValue       = eventGame.GamePhase.ToString();
                txtStartYear.Text                = eventGame.StartDate.Year.ToString();
                ddlStartMonth.SelectedValue      = eventGame.StartDate.Month.ToString();
                ddlStartDay.SelectedValue        = eventGame.StartDate.Day.ToString();
                ddlStartHour.SelectedValue       = eventGame.StartDate.ToString("hh");
                ddlStartMinute.SelectedValue     = eventGame.StartDate.Minute.ToString();
                ddlStartTimePeriod.SelectedValue = eventGame.StartDate.ToString("tt");
                txtEndYear.Text                  = eventGame.EndDate.Year.ToString();
                ddlEndMonth.SelectedValue        = eventGame.EndDate.Month.ToString();
                ddlEndDay.SelectedValue          = eventGame.EndDate.Day.ToString();
                ddlEndHour.SelectedValue         = eventGame.EndDate.ToString("hh");
                ddlEndMinute.SelectedValue       = eventGame.EndDate.Minute.ToString();
                ddlEndTimePeriod.SelectedValue   = eventGame.EndDate.ToString("tt");
                txtLocation.Text                 = eventGame.Location;
                ddlWinner.SelectedValue          = eventGame.WinnerTeamID.ToString();
                chkFinished.Checked              = eventGame.IsFinished;
            }



            if (blnHasAccess)
            {
                trSaveSchedule.Visible = true;
            }
            else
            {
                trSaveSchedule.Visible     = false;
                ddlGamePhase.Enabled       = false;
                ddlStartMonth.Enabled      = false;
                ddlStartDay.Enabled        = false;
                txtStartYear.Enabled       = false;
                ddlStartHour.Enabled       = false;
                ddlStartMinute.Enabled     = false;
                ddlStartTimePeriod.Enabled = false;

                ddlEndMonth.Enabled      = false;
                ddlEndDay.Enabled        = false;
                txtEndYear.Enabled       = false;
                ddlEndHour.Enabled       = false;
                ddlEndMinute.Enabled     = false;
                ddlEndTimePeriod.Enabled = false;
                txtLocation.ReadOnly     = true;
                txtLocation.BackColor    = System.Drawing.Color.AliceBlue;
                ddlWinner.Enabled        = false;
                chkFinished.Enabled      = false;
            }

            this.LoadOfficials();
            this.LoadCompetingTeams();
        }
    }