Beispiel #1
0
        private static SkillFacade CreateFacade(
            Mock <QueryObjectBase <SkillTagDto, SkillTag, SkillTagFilterDto, IQuery <SkillTag> > > skillQueryMock,
            Mock <IRepository <SkillTag> > skillRepositoryMock)
        {
            var uowMock = FacadeMockManager.ConfigureUowMock();
            var mapper  = FacadeMockManager.ConfigureRealMapper();
            var service = new SkillService(mapper, skillRepositoryMock.Object, skillQueryMock.Object);
            var facade  = new SkillFacade(uowMock.Object, service);

            return(facade);
        }
Beispiel #2
0
        public void SectionInit(int sectionNo)
        {
            if (sectionNo > 0)
            {
                this.ClearDisable();
                this.ChangeSide();
            }
            foreach (var player in _players)
            {
                player.SectionInit(sectionNo);
            }
            List <string> skills = null;

            if (null == _input.Skills)
            {
                skills = new List <string>(2);
            }
            else
            {
                skills = new List <string>(_input.Skills.Count + 2);
                skills.AddRange(_input.Skills);
            }
            if (null != _input.SubSkills && sectionNo < _input.SubSkills.Length)
            {
                var talent = _input.SubSkills[sectionNo];
                if (!string.IsNullOrEmpty(talent))
                {
                    skills.Add(talent);
                }
            }
            SkillFacade.LoadManagerSkills(_match, this, skills);
            if (sectionNo == 0)
            {
                SkillFacade.LoadHideSkills(_match, this);
            }
        }
Beispiel #3
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();
            }
        }