예제 #1
0
        public void CheckModeRestrictions(PlayAgainEvent e, SingleNode <ChosenMatchMackingModeComponent> chosenMode, [JoinAll] ICollection <MatchMakingModeNode> modes, [JoinAll] UserNode user, [JoinByUser] MountedHullNode hull, [JoinAll] ButtonNode button)
        {
            int    level      = hull.upgradeLevelItem.Level;
            Entity modeEntity = chosenMode.component.ModeEntity;

            if (modeEntity != null)
            {
                MatchMakingModeRestrictionsComponent component = modeEntity.GetComponent <MatchMakingModeRestrictionsComponent>();
                int rank = user.userRank.Rank;
                e.MatchMackingMode = modeEntity;
                e.ModeIsAvailable  = (rank <= component.MaximalShowRank) && (rank >= component.MinimalShowRank);
                MainScreenComponent.Instance.ShowHome();
                if (!e.ModeIsAvailable)
                {
                    MainScreenComponent.Instance.ShowOrHideScreen(MainScreenComponent.MainScreens.PlayScreen, true);
                }
                else
                {
                    button.esm.Esm.ChangeState <PlayButtonStates.SearchingState>();
                    MainScreenComponent.Instance.ShowMatchSearching(modeEntity.GetComponent <DescriptionItemComponent>().Name);
                }
            }
        }
예제 #2
0
 private bool CanShowByRestrictions(MatchMakingModeRestrictionsComponent restrictions, int userRank) =>
 (userRank <= restrictions.MaximalShowRank) && (userRank >= restrictions.MinimalShowRank);