public NetInfoGroupViewReadModel(NetInfoGroup netInfoGroup, bool prefabFound, string displayNameOriginal = null, string displayNameReplacement = null)
        {
            _netInfoGroup = netInfoGroup ?? throw new ArgumentNullException(nameof(netInfoGroup));
            PrefabFound   = prefabFound;

            if (prefabFound)
            {
                DisplayNameOriginal = displayNameOriginal ?? throw new ArgumentNullException(nameof(displayNameOriginal));

                if (_netInfoGroup.HasAnyReplacements)
                {
                    DisplayNameReplacement = displayNameReplacement ?? throw new ArgumentNullException(nameof(displayNameReplacement) + "; SystemNameOriginal: " + netInfoGroup.SystemNameOriginal + "; Replacement: " + netInfoGroup.SystemNameReplacement);
                }
            }
        }
コード例 #2
0
        public NetInfoGroupViewReadModel(NetInfoGroup netInfoGroup, bool prefabFound, string displayNameOriginal = null, string displayNameReplacement = null)
        {
            this.netInfoGroup = netInfoGroup ?? throw new System.ArgumentNullException(nameof(netInfoGroup));
            this.PrefabFound  = prefabFound;

            if (prefabFound)
            {
                //if the prefab was found,
                this.DisplayNameOriginal = displayNameOriginal ?? throw new System.ArgumentNullException(nameof(displayNameOriginal));

                if (this.netInfoGroup.HasAnyReplacements)
                {
                    this.DisplayNameReplacement = displayNameReplacement ?? throw new System.ArgumentNullException(nameof(displayNameReplacement));
                }
            }
        }
コード例 #3
0
        public NetInfoGroupViewReadModel Create(NetInfoGroup netInfoGroup)
        {
            var displayNameOriginal = GetCachedDisplayName(netInfoGroup.SystemNameOriginal);

            if (displayNameOriginal == null)
            {
                return(new NetInfoGroupViewReadModel(netInfoGroup, false));
            }

            if (netInfoGroup.SystemNameReplacement == null)
            {
                return(new NetInfoGroupViewReadModel(netInfoGroup, true, displayNameOriginal));
            }

            var titleReplacement = GetCachedDisplayName(netInfoGroup.SystemNameReplacement);

            return(new NetInfoGroupViewReadModel(netInfoGroup, true, displayNameOriginal, titleReplacement));
        }