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


C# GenericWriter.WriteGuildList方法代码示例

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


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

示例1: Serialize

		public override void Serialize( GenericWriter writer )
		{
			if ( this.LastFealty+TimeSpan.FromDays( 1.0 ) < DateTime.UtcNow )
				this.CalculateGuildmaster();

			CheckExpiredWars();

			if( Alliance != null )
				Alliance.CheckLeader();

			writer.Write( (int) 5 );//version

			#region War Serialization
			writer.Write( m_PendingWars.Count );

			for( int i = 0; i < m_PendingWars.Count; i++ )
			{
				m_PendingWars[i].Serialize( writer );
			}

			writer.Write( m_AcceptedWars.Count );

			for( int i = 0; i < m_AcceptedWars.Count; i++ )
			{
				m_AcceptedWars[i].Serialize( writer );
			}
			#endregion

			#region Alliances

			bool isAllianceLeader = (m_AllianceLeader == null && m_AllianceInfo != null );
			writer.Write( isAllianceLeader );

			if( isAllianceLeader )
				m_AllianceInfo.Serialize( writer );
			else
				writer.Write( m_AllianceLeader );

			#endregion

			//

			writer.WriteGuildList( m_AllyDeclarations, true );
			writer.WriteGuildList( m_AllyInvitations, true );

			writer.Write( m_TypeLastChange );

			writer.Write( (int)m_Type );

			writer.Write( m_LastFealty );

			writer.Write( m_Leader );
			writer.Write( m_Name );
			writer.Write( m_Abbreviation );

			writer.WriteGuildList<Guild>( m_Allies, true );
			writer.WriteGuildList<Guild>( m_Enemies, true );
			writer.WriteGuildList( m_WarDeclarations, true );
			writer.WriteGuildList( m_WarInvitations, true );

			writer.Write( m_Members, true );
			writer.Write( m_Candidates, true );
			writer.Write( m_Accepted, true );

			writer.Write( m_Guildstone );
			writer.Write( m_Teleporter );

			writer.Write( m_Charter );
			writer.Write( m_Website );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:70,代码来源:Guild.cs

示例2: Serialize

        public override void Serialize( GenericWriter writer )
        {
            if ( this.LastFealty + TimeSpan.FromMinutes( 1.0 ) < DateTime.Now )
            {
                this.CalculateGuildmaster();
            }

            writer.Write( (int) 5 ); //version

            writer.WriteGuildList( m_WarInitializations, true );
            writer.Write( (int) m_WarKills.Length );

            for ( int i = 0; i < m_WarKills.Length; ++i )
            {
                writer.Write( m_WarKills[i].w_Guild );
                writer.Write( (int) m_WarKills[i].Kills );
                writer.Write( (int) m_WarKills[i].MaxKills );
                writer.Write( (uint) m_WarKills[i].WarTime );
                writer.Write( (uint) m_WarKills[i].ExpTime );
            }

            writer.Write( (bool) m_AllianceLeader );
            writer.Write( m_AllianceName );

            writer.WriteGuildList( m_AllyDeclarations, true );
            writer.WriteGuildList( m_AllyInvitations, true );

            writer.Write( m_TypeLastChange );

            writer.Write( (int) m_Type );

            writer.Write( m_LastFealty );

            writer.Write( m_Leader );
            writer.Write( m_Name );
            writer.Write( m_Abbreviation );

            writer.WriteGuildList( m_Allies, true );
            writer.WriteGuildList( m_Enemies, true );
            writer.WriteGuildList( m_WarDeclarations, true );
            writer.WriteGuildList( m_WarInvitations, true );

            writer.WriteMobileList( m_Members, true );
            writer.WriteMobileList( m_Candidates, true );
            writer.WriteMobileList( m_Accepted, true );

            writer.Write( m_Guildstone );
            writer.Write( m_Teleporter );

            writer.Write( m_Charter );
            writer.Write( m_Website );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:52,代码来源:Guild.cs


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