public void SetTotal(BatchMatchEntity batchMatchEntity)
        {
            HomeScore  = _match.HomeScore;
            AwayScore  = _match.AwayScore;
            TotalRound = _match.Status.TotalRound;
            HomeManager.SetTotal(batchMatchEntity.HomeManager);
            AwayManager.SetTotal(batchMatchEntity.AwayManager);
            int endRound = 0;

            for (int i = 0; i < _match.Report.BallResults.Count; i++)
            {
                var ballResult = _match.Report.BallResults[i];
                if (ballResult.AsRound > endRound)
                {
                    if (ballResult.StateData.State != 0 || ballResult.ClassId > 1)
                    {
                        var entity = new StatisticsBallEntity(_match, i, ballResult);
                        if (entity.EndRound > 0)
                        {
                            endRound = entity.EndRound;
                        }
                        StatisticsBallResults.Add(entity);
                    }
                }
            }
        }
Example #2
0
        public void SaveRpt()
        {
            int round = this.Status.Round;

            if (round > this.Status.TotalRound)
            {
                return;
            }
            HomeManager.SaveRpt();
            AwayManager.SaveRpt();
            //统计数据
            if (_statisticsCallback != null)
            {
                _statisticsCallback();
            }

            var list = this._report.BallResults;
            int dif  = list.Count == 0 ? 2 : round - list[list.Count - 1].AsRound;

            if (dif <= 0)
            {
                return;
            }
            var obj = _status.MatchState.SaveRpt(this);

            if (null != obj)
            {
                obj.Round = (round == 1 || dif > 1) ? round : 0;
                list.Add(obj);
            }
        }
 public void AddProcess()
 {
     if (_match.Status.Round > 0)
     {
         HomeManager.AddProcess(_match.Status.Round, _match.Managers[0]);
         AwayManager.AddProcess(_match.Status.Round, _match.Managers[1]);
     }
 }
Example #4
0
 public void SaveRptEnd()
 {
     HomeManager.SaveRptEnd();
     AwayManager.SaveRptEnd();
     _report.HomeScore   = HomeScore;
     _report.AwayScore   = AwayScore;
     _report.HomeManager = HomeManager.Report;
     _report.AwayManager = AwayManager.Report;
 }
Example #5
0
        void InnerBinWrite(BinaryWriter writer, int verNo)
        {
            verNo = this.VerNo;
            writer.Write((byte)verNo);
            writer.Write((byte)MatchType);
            writer.Write((byte)MapId);
            writer.Write((byte)HomeScore);
            writer.Write((byte)AwayScore);
            HomeManager.BinWrite(writer, verNo);
            AwayManager.BinWrite(writer, verNo);
            int cnt = CntBallResults;

            writer.Write((ushort)cnt);
            if (cnt > 0)
            {
                foreach (var item in BallResults)
                {
                    item.BinWrite(writer, verNo);
                }
            }
        }
Example #6
0
        public void RoundInit()
        {
            _status.MatchState = _football.IsInAir ? AirBallState.Instance : DefaultBallState.Instance;
            _status.GoalState  = false;
            _status.FoulState  = EnumMatchFoulState.None;
            _status.FoulPlayer = null;
            _status.Break(EnumMatchBreakState.None);
            _football.TurnFlag = false;
            short round      = _status.Round;
            int   minute     = MatchRule.ConvertRound2Minute(round, _status.TotalRound);
            int   sectionNo  = -1;
            bool  minuteFlag = false;

            if (round == 0)
            {
                sectionNo  = 0;
                minuteFlag = true;
            }
            else if (_status.Minute != minute)
            {
                minuteFlag = true;
                if (minute == 46)
                {
                    sectionNo = 1;
                }
            }
            if (sectionNo >= 0)
            {
                _status.SectionNo = sectionNo;
                HomeManager.SectionInit(sectionNo);
                AwayManager.SectionInit(sectionNo);
                SkillFacade.TriggerManagerSkills(HomeManager, 0);
                SkillFacade.TriggerManagerSkills(AwayManager, 0);
                foreach (var player in HomeManager.Players)
                {
                    SkillFacade.TriggerPlayerSkills(player, 0);
                }
                foreach (var player in AwayManager.Players)
                {
                    SkillFacade.TriggerPlayerSkills(player, 0);
                }
            }
            if (minuteFlag)
            {
                _status.Minute = (short)minute;
                HomeManager.MinuteInit();
                AwayManager.MinuteInit();
            }
            if (sectionNo >= 0)
            {
                _openSide = _openSide == Side.Home ? Side.Away : Side.Home;
                _status.Break(EnumMatchBreakState.SectionOpen);
                Openball(_openSide == Side.Home ? _homeManager : _awayManager);
            }
            if (null != _status.BallHandler && _status.BallHandler.Disable)
            {
                _status.IsNoBallHandler = true;
            }
            if (_status.IsNoBallHandler)
            {
                RefreshBallHandler();
            }
            if (HomeManager.IsAttackSide)
            {
                AwayManager.RoundInit();
                HomeManager.RoundInit();
            }
            else
            {
                HomeManager.RoundInit();
                AwayManager.RoundInit();
            }
        }