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


C# Village.ToString方法代码示例

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


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

示例1: DetailsCommand

 public DetailsCommand(DetailsDisplayEnum display, Village village, VillageTools tool)
 {
     Tooltip = village.ToString();
     Display = display;
     if (Display == DetailsDisplayEnum.None) Display = DetailsDisplayEnum.Village;
     else if (Display == DetailsDisplayEnum.Player && !village.HasPlayer) Display = DetailsDisplayEnum.Village;
     else if (Display == DetailsDisplayEnum.Tribe && !village.HasTribe) Display = DetailsDisplayEnum.Village;
     UnderlyingDisplay = DetailsDisplayEnum.Village;
     Village = village;
     Tool = tool;
     if (village.HasPlayer)
     {
         Player = village.Player;
         if (Player.HasTribe)
         {
             Tribe = Player.Tribe;
         }
     }
 }
开发者ID:kindam,项目名称:TWTactics,代码行数:19,代码来源:DetailsCommand.cs

示例2: Match

        /// <summary>
        /// Checks if the village matches the current search criteria
        /// </summary>
        public bool Match(Village village)
        {
            if (SearchStrategy == FinderOptionsEnum.Nobled)
            {
                if (!village.HasPlayer || village.PreviousVillageDetails == null || village.Player.Equals(village.PreviousVillageDetails.Player))
                    return false;

                if (Tribe != null &&
                    (
                        (!village.HasTribe || !Tribe.Equals(village.Player.Tribe))
                        &&
                        (!village.PreviousVillageDetails.HasTribe || !Tribe.Equals(village.PreviousVillageDetails.Player.Tribe))
                     )
                    )
                    return false;
            }
            else
            {
                if (Tribe != null && (!village.HasTribe || !Tribe.Equals(village.Player.Tribe)))
                    return false;

                switch (SearchStrategy)
                {
                    case FinderOptionsEnum.NewInactives:
                        if (village.HasPlayer || village.PreviousVillageDetails == null || !village.PreviousVillageDetails.HasPlayer)
                            return false;
                        break;
                    case FinderOptionsEnum.LostPoints:
                        if (village.PreviousVillageDetails == null || village.Points >= village.PreviousVillageDetails.Points)
                            return false;
                        break;
                }
            }

            if (!string.IsNullOrEmpty(Text) && !village.ToString().ToUpper(CultureInfo.InvariantCulture).Contains(Text))
            {
                return false;
            }

            if (village.Points < PointsBetweenStart || (PointsBetweenEnd > 0 && village.Points > PointsBetweenEnd))
                return false;

            return true;
        }
开发者ID:kindam,项目名称:TWTactics,代码行数:47,代码来源:FinderOptions.cs

示例3: Map_MouseMoved

 private void Map_MouseMoved(MouseEventArgs e, Point mapLocation, Village village, Point activeLocation, Point activeVillage)
 {
     StatusXY.Text = string.Format("{0}|{1}", activeLocation.X, activeLocation.Y);
     if (village == null)
     {
         StatusPlayer.Text = string.Empty;
         StatusTribe.Text = string.Empty;
         StatusVillage.Text = string.Empty;
     }
     else
     {
         StatusPlayer.Text = village.HasPlayer ? string.Format("{0} (#{1})", village.Player.Name, village.Player.Rank) : string.Empty;
         StatusTribe.Text = village.HasTribe ? village.Player.Tribe.ToString() : string.Empty;
         StatusVillage.Text = village.ToString();
     }
 }
开发者ID:kindam,项目名称:TWTactics,代码行数:16,代码来源:MainForm.cs


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