当前位置: 首页>>代码示例>>C#>>正文


C# DataTypes.IsFlagSet方法代码示例

本文整理汇总了C#中DataTypes.IsFlagSet方法的典型用法代码示例。如果您正苦于以下问题:C# DataTypes.IsFlagSet方法的具体用法?C# DataTypes.IsFlagSet怎么用?C# DataTypes.IsFlagSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataTypes的用法示例。


在下文中一共展示了DataTypes.IsFlagSet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadData

		public bool LoadData( List<Mod> selected, DataTypes dataList )
		{
			Clear( dataList );

			#region Dynasties and Cultures
			if( dataList.IsFlagSet<DataTypes>( DataTypes.Dynasties ) )
			{
				m_log.Log( "Loading Dynasties", Logger.LogType.Data );
				if( !LoadData( m_dynastyReader, selected, @"common\dynasties", "dynasties", "*.txt", true ) )
					return false;
				Dynasties = new ReadOnlyDictionary<int, Dynasty>( m_dynastyReader.Dynasties );
				m_log.Log( "  --Dynasties: " + m_dynastyReader.Dynasties.Count, Logger.LogType.Data );
			}

			if( dataList.IsFlagSet<DataTypes>( DataTypes.Cultures ) )
			{
				m_log.Log( "Loading Cultures", Logger.LogType.Data );
				if( !LoadData( m_cultureReader, selected, @"common\cultures", "cultures", "*.txt", true ) )
					return false;
				Cultures = new ReadOnlyDictionary<string, Culture>( m_cultureReader.Cultures );
				CultureGroups = new ReadOnlyDictionary<string, CultureGroup>( m_cultureReader.CultureGroups );
				m_log.Log( " --Culture Groups: " + m_cultureReader.CultureGroups.Count, Logger.LogType.Data );
				m_log.Log( " --Cultures: " + m_cultureReader.Cultures.Count, Logger.LogType.Data );
			}
			#endregion

			#region Titles
			if( dataList.IsFlagSet<DataTypes>( DataTypes.LandedTitles ) )
			{
				m_log.Log( "Loading Titles", Logger.LogType.Data );
				if( !LoadData( m_titleReader, selected, @"common\landed_titles", "landed_titles", "*.txt", true ) )
					return false;
				Counties = new ReadOnlyDictionary<string, Title>( m_titleReader.Counties );
				Duchies = new ReadOnlyDictionary<string, Title>( m_titleReader.Duchies );
				Kingdoms = new ReadOnlyDictionary<string, Title>( m_titleReader.Kingdoms );
				Empires = new ReadOnlyDictionary<string, Title>( m_titleReader.Empires );

				m_log.Log( " --Empires: " + m_titleReader.Empires.Count, Logger.LogType.Data );
				m_log.Log( " --Kingdoms: " + m_titleReader.Kingdoms.Count, Logger.LogType.Data );
				m_log.Log( " --Duchies: " + m_titleReader.Duchies.Count, Logger.LogType.Data );
				m_log.Log( " --Counties: " + m_titleReader.Counties.Count, Logger.LogType.Data );
			}
			#endregion

			#region Religions
			if( dataList.IsFlagSet<DataTypes>( DataTypes.Religions ) )
			{
				m_log.Log( "Loading Religions", Logger.LogType.Data );
				if( !LoadData( m_religionReader, selected, @"common\religions", "religions", "*.txt", true ) )
					return false;
				Religions = new ReadOnlyDictionary<string, Religion>( m_religionReader.Religions );
				ReligionGroups = new ReadOnlyDictionary<string, ReligionGroup>( m_religionReader.ReligionGroups );
				m_log.Log( " --Religion Groups: " + m_religionReader.ReligionGroups.Count, Logger.LogType.Data );
				m_log.Log( " --Religions: " + m_religionReader.Religions.Count, Logger.LogType.Data );
			}
			#endregion

			#region Localisations

			if( dataList.IsFlagSet<DataTypes>( DataTypes.Localisations ) )
			{
				m_log.Log( "Loading Localisations", Logger.LogType.Data );
				if( !LoadData( m_localisationStrings, selected, @"localisation", "localisations", "*.csv", true ) )
					return false;
				Localisations = new ReadOnlyDictionary<string, string>( m_localisationStrings.LocalisationStrings );
				m_log.Log( " --Localisations: " + m_localisationStrings.LocalisationStrings.Count, Logger.LogType.Data );
			}
			#endregion

			#region Provinces and Mods
			if( dataList.IsFlagSet<DataTypes>( DataTypes.Provinces ) )
			{
				m_log.Log( "Loading Provinces", Logger.LogType.Data );
				if( !LoadData( m_provinceReader, selected, @"history\provinces", "provinces", "*.txt", true ) )
					return false;
				Provinces = new ReadOnlyDictionary<int, Province>( m_provinceReader.Provinces );
				m_log.Log( " --Provinces: " + m_provinceReader.Provinces.Count, Logger.LogType.Data );
			}

			if( dataList.IsFlagSet<DataTypes>( DataTypes.Mods ) )
			{
				m_log.Log( "Loading Mods", Logger.LogType.Data );
				if( !LoadMods() )
					return false;
				GetMods = m_modReader.Mods.AsReadOnly();
				m_log.Log( " --Mods:" + m_modReader.Mods.Count, Logger.LogType.Data );
			}
			#endregion

			#region Converter Table and History

			if( dataList.IsFlagSet<DataTypes>( DataTypes.ConvertTable ) )
			{
				m_log.Log( "Loading Converter Table", Logger.LogType.Data );
				if( !LoadData( m_converterTableReader, selected, "common/eu4_converter", "converter", "*.csv", false ) )
					return false;
				NationTable = new ReadOnlyDictionary<string, string>( m_converterTableReader.Nations );
				m_log.Log( " --Nation Tables: " + m_converterTableReader.Nations.Count, Logger.LogType.Data );
			}
			#endregion
//.........这里部分代码省略.........
开发者ID:Measter,项目名称:TitleGenerator,代码行数:101,代码来源:CK2Data.cs

示例2: LinkData

		public bool LinkData( List<Mod> selected, DataTypes dataList )
		{
			if ( dataList.IsFlagSet<DataTypes>( DataTypes.Cultures | DataTypes.Dynasties ) )
				m_dynastyReader.LinkCultures( m_cultureReader.Cultures );

			if( dataList.IsFlagSet<DataTypes>( DataTypes.LandedTitles | DataTypes.Provinces ) )
				m_titleReader.LinkCounties( m_provinceReader.Provinces );

			//Parse adjacencies
			if ( dataList.IsFlagSet<DataTypes>( DataTypes.Provinces ) )
				if ( !ParseAdjacencies( selected ) )
					return false;

			return true;
		}
开发者ID:Measter,项目名称:TitleGenerator,代码行数:15,代码来源:CK2Data.cs

示例3: Clear

		public void Clear( DataTypes dataList )
		{
			#region Cultures and Dynasties
			if( dataList.IsFlagSet<DataTypes>( DataTypes.Cultures ) )
			{
				m_cultureReader.CultureGroups.Clear();
				m_cultureReader.Cultures.Clear();
				m_cultureReader.Errors.Clear();
			}

			if( dataList.IsFlagSet<DataTypes>( DataTypes.Dynasties ) )
			{
				m_dynastyReader.Dynasties.Clear();
				m_dynastyReader.Errors.Clear();
			}
			#endregion

			#region Landed Titles
			if( dataList.IsFlagSet<DataTypes>( DataTypes.LandedTitles ) )
			{
				m_titleReader.Counties.Clear();
				m_titleReader.Duchies.Clear();
				m_titleReader.Kingdoms.Clear();
				m_titleReader.Empires.Clear();
				m_titleReader.Errors.Clear();
			}
			#endregion

			#region Religions and Traits
			if( dataList.IsFlagSet<DataTypes>( DataTypes.Religions ) )
			{
				m_religionReader.Religions.Clear();
				m_religionReader.ReligionGroups.Clear();
				m_religionReader.Errors.Clear();
			}
			#endregion

			#region Localisations
			if( dataList.IsFlagSet<DataTypes>( DataTypes.Localisations ) )
			{
				m_localisationStrings.LocalisationStrings.Clear();
				m_localisationStrings.Errors.Clear();
			}
			#endregion

			#region Mods and Provinces
			if( dataList.IsFlagSet<DataTypes>( DataTypes.Mods ) )
			{
				m_modReader.Mods.Clear();
				m_modReader.Errors.Clear();
			}

			if( dataList.IsFlagSet<DataTypes>( DataTypes.Provinces ) )
			{
				m_provinceReader.Provinces.Clear();
				m_provinceReader.Errors.Clear();
			}
			#endregion
		}
开发者ID:Measter,项目名称:TitleGenerator,代码行数:59,代码来源:CK2Data.cs


注:本文中的DataTypes.IsFlagSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。