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


C# Guild.IsAlly方法代码示例

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


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

示例1: DiplomacyMiscGump

        public DiplomacyMiscGump( Mobile leader, Guild target )
            : base(10, 40)
        {
            m_Mobile = leader;
            t_Guild = target;
            m_Guild = m_Mobile.Guild as Guild;

            /*0*/
            Intern( "Unknown" );
            /*1*/
            Intern( "" );
            /*2*/
            Intern( "" );
            /*3*/
            Intern( "0/0" );
            /*4*/
            Intern( "0/0" );
            /*5*/
            Intern( "00:00" );
            /*6*/
            Intern( target.Name );
            /*7*/
            Intern( "<basefont color=#black>" + t_Guild.AllianceName + "</basefont>" );
            /*8*/
            Intern( target.Abbreviation );
            /*9*/
            Intern( "<basefont color=#black>0/0</basefont>" );
            /*10*/
            Intern( "<basefont color=#black>00:00</basefont>" );
            /*11*/
            Intern( "<basefont color=#black>0/0</basefont>" );

            AddPage( 0 );

            AddBackground( 0, 0, 520, 335, 0x242C );

            AddHtmlLocalized( 20, 15, 480, 26, 1062975, false, false ); // <div align=center><i>Guild Relationship</i></div>
            AddImageTiled( 20, 40, 480, 2, 0x2711 );

            AddHtmlLocalized( 20, 50, 120, 26, 1062954, true, false ); // <i>Guild Name</i>
            AddHtmlIntern( 150, 53, 360, 26, 6, false, false );

            AddHtmlLocalized( 20, 80, 120, 26, 1063025, true, false ); // <i>Alliance</i>
            AddHtmlIntern( 150, 83, 360, 26, 7, false, false );

            AddHtmlLocalized( 20, 110, 120, 26, 1063139, true, false ); // <i>Abbreviation</i>
            AddHtmlIntern( 150, 113, 120, 26, 8, false, false );

            AddHtmlLocalized( 280, 110, 120, 26, 1062966, true, false ); // <i>Your Kills</i>
            AddHtmlIntern( 410, 113, 120, 26, 9, false, false );

            AddHtmlLocalized( 20, 140, 120, 26, 1062968, true, false ); // <i>Time Remaining</i>
            AddHtmlIntern( 150, 143, 120, 26, 10, false, false );

            AddHtmlLocalized( 280, 140, 120, 26, 1062967, true, false ); // <i>Their Kills</i>
            AddHtmlIntern( 410, 143, 120, 26, 11, false, false );

            AddImageTiled( 20, 172, 480, 2, 0x2711 );

            AddBackground( 275, 290, 225, 26, 0x2486 );
            AddButton( 280, 295, 0x845, 0x846, 0, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 305, 293, 185, 26, 3000091, false, false ); // Cancel

            AddBackground( 20, 290, 225, 26, 0x2486 );
            AddButton( 25, 295, 0x845, 0x846, 400, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 50, 293, 185, 26, 1062989, false, false ); // Declare War!

            AddBackground( 20, 260, 225, 26, 0x2486 );
            AddButton( 25, 265, 0x845, 0x846, 305, GumpButtonType.Reply, 0 ); // Request Alliance
            AddHtmlLocalized( 50, 263, 185, 26, 1062990, false, false );

            if ( m_Guild.IsWar( t_Guild ) )
                AddHtmlLocalized( 20, 180, 480, 30, 1062965, true, false ); // war
            else if ( m_Guild.IsAlly( t_Guild ) )
                AddHtmlLocalized( 20, 180, 480, 30, 1062970, true, false ); // allied
            else
                AddHtmlLocalized( 20, 180, 480, 30, 1062973, true, false ); // peace

            AddImageTiled( 20, 245, 480, 2, 0x2711 );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:80,代码来源:DiplomacyMiscGump.cs

示例2: GetPercentageOfGuildedHousesInArea

		public static double GetPercentageOfGuildedHousesInArea(Point3D location, Map map, int radius, Guild guild, bool bIgnoreAlliedHouses)
		{
			double guildPercentage = 0.0;

			if (guild == null) return guildPercentage; //doublecheck this - return 0 if we're not guilded
			if (location == Point3D.Zero) return guildPercentage; //might as well check that we're not the default point

			try //safety
			{
				int x = location.X;
				int y = location.Y;
				int z = location.Z;

				int x_start = x - radius;
				int y_start = y - radius;
				int x_end = x + radius;
				int y_end = y + radius;

				Rectangle2D rect = new Rectangle2D(x_start, y_start, TownshipStone.INITIAL_RADIUS * 2, TownshipStone.INITIAL_RADIUS * 2);
				List<BaseHouse> houseList = TownshipDeed.GetHousesInRect(rect, map);

				int guildCount = 0;
				int allyCount = 0;
				int otherCount = 0;

				int siegetentCount = 0;

				int countedHouses = 0;

				foreach (BaseHouse h in houseList)
				{
					if (h != null && h.Owner != null)
					{
						countedHouses++;

						Guild houseGuild = h.Owner.Guild as Guilds.Guild;

						if (h is SiegeTent)
						{
							siegetentCount++;
						}
						else
						{
							if (houseGuild == null)
							{
								otherCount++;
							}
							else if (houseGuild == guild)
							{
								guildCount++;
							}
							else if (guild.IsAlly(houseGuild))
							{
								allyCount++;
							}
							else
							{
								otherCount++;
							}
						}
					}
				}

				guildPercentage = ((double)guildCount) / ((double)(countedHouses - allyCount - siegetentCount));
			}
			catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }
			return guildPercentage;
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:68,代码来源:TownshipDeed.cs

示例3: DiplomacyGump


//.........这里部分代码省略.........
                    {
                        m_List.Sort( new ListNameSorter( updown ) );
                        break;
                    }
                case 1:
                    {
                        m_List.Sort( new ListAbbrSorter( updown ) );
                        break;
                    }
                case 2:
                    {
                        m_SortWarList = new ArrayList();
                        m_SortAllyList = new ArrayList();

                        int j = 0;

                        while ( j < m_List.Count )
                        {
                            if ( ( (Guild) m_List[j] ).IsWar( m_Guild ) )
                            {
                                m_SortWarList.Add( m_List[j] );
                                m_List.Remove( m_List[j] );
                            }
                            else
                            {
                                j++;
                            }
                        }

                        j = 0;

                        while ( j < m_List.Count )
                        {
                            if ( ( (Guild) m_List[j] ).IsAlly( m_Guild ) )
                            {
                                m_SortAllyList.Add( m_List[j] );
                                m_List.Remove( m_List[j] );
                            }
                            else
                            {
                                j++;
                            }
                        }

                        m_SortAllyList.Sort( new ListNameSorter( updown ) );
                        m_SortWarList.Sort( new ListNameSorter( updown ) );
                        m_List.Sort( new ListNameSorter( updown ) );

                        for ( j = 0; j < m_SortAllyList.Count; j++ )
                            m_SortWarList.Add( m_SortAllyList[j] );

                        for ( j = 0; j < m_List.Count; j++ )
                            m_SortWarList.Add( m_List[j] );

                        m_List = m_SortWarList;
                        break;
                    }
                case 3:
                    {
                        m_List.Sort( new ListRelationshipSorter( updown ) );
                        break;
                    }
                case 4:
                    {
                        m_List.Sort( new ListAwaitingSorter( updown ) );
                        break;
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:67,代码来源:DiplomacyGump.cs


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