public async Task <IActionResult> Edit(int id, [Bind("Id,MatchTimeName")] MatchTime matchTime)
        {
            if (id != matchTime.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(matchTime);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MatchTimeExists(matchTime.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(matchTime));
        }
Esempio n. 2
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Esempio n. 3
0
 public static void ResetWins()
 {
     if (isIronMan)
     {
         MoreMatchTypes_Form.moreMatchTypesForm.Enabled = true;
         currMatchTime = null;
     }
 }
        public async Task <IActionResult> Create([Bind("Id,MatchTimeName")] MatchTime matchTime)
        {
            if (ModelState.IsValid)
            {
                _context.Add(matchTime);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(matchTime));
        }
Esempio n. 5
0
    // バイト列に変換して送信データに書き込むメソッド
    private static short SerializeMatchTime(StreamBuffer outStream, object customObject)
    {
        MatchTime matchTime = (MatchTime)customObject;
        int       index     = 0;

        lock (bufferMatchTime)
        {
            Protocol.Serialize(matchTime.Value, bufferMatchTime, ref index);
            outStream.Write(bufferMatchTime, 0, index);
        }
        return((short)index); // 書き込んだバイト数を返す
    }
Esempio n. 6
0
        public static void SetMatchRules()
        {
            if (MoreMatchTypes_Form.moreMatchTypesForm.cb_IronManMatch.Checked && GlobalWork.inst.MatchSetting.BattleRoyalKind == BattleRoyalKindEnum.Off)
            {
                isIronMan = true;
            }
            else
            {
                isIronMan = false;
            }

            if (!isIronMan)
            {
                return;
            }

            wins          = new int[2];
            endMatch      = false;
            currMatchTime = null;

            SetTeamNames();
            MoreMatchTypes_Form.moreMatchTypesForm.Enabled = false;
        }
Esempio n. 7
0
        public static bool SetMatchRestrictions()
        {
            if (!isIronMan)
            {
                return(false);
            }
            else
            {
                //Determine if this is a draw
                MatchMain main = MatchMain.inst;

                //If a victory condition is met
                if (!main.isTimeUp)
                {
                    //Signal that the current round has ended
                    Referee matchRef = RefereeMan.inst.GetRefereeObj();
                    matchRef.PlDir = PlDirEnum.Left;
                    matchRef.ReqRefereeAnm(BasicSkillEnum.Refe_Stand_MatchEnd_Front_Left);
                    Announcer.inst.PlayGong_Eliminated();

                    int loser = 0;
                    for (int i = 0; i < 8; i++)
                    {
                        Player plObj = PlayerMan.inst.GetPlObj(i);
                        if (!plObj)
                        {
                            continue;
                        }
                        if (plObj.isLose)
                        {
                            loser = i;
                        }
                        if (plObj.isKO)
                        {
                            plObj.isKO = false;
                        }
                    }

                    //Record the last win and display the current score
                    if (loser <= 3)
                    {
                        wins[1]++;
                    }
                    else
                    {
                        wins[0]++;
                    }

                    //Prepare the next round
                    WaitForNextRound();
                    main.isMatchEnd = false;
                    main.isRoundEnd = true;
                    currMatchTime   = new MatchTime
                    {
                        min = main.matchTime.min,
                        sec = main.matchTime.sec
                    };
                    main.isTimeCounting = false;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Esempio n. 8
0
 public override string ToString()
 {
     return(MatchTime.ToShortTimeString());
 }