コード例 #1
0
        public string GetModifierTextForTechnology(Technology tech)
        {
            List <string> output      = new List <string>();
            string        description = "";

            foreach (TechnologyModifier techModifier in tech.TechnologyModifiers)
            {
                switch (techModifier.ModifierId)
                {
                case ("MATHEMATICS_ADJUST_SEA_MOVEMENT"):

                    description = ("Increases Sea Movement by 1.");
                    break;

                case ("CARTOGRAPHY_GRANT_OCEAN_NAVIGATION"):
                    description = ("Allows units to traverse Ocean.");
                    break;

                case ("CARTOGRAPHY_ADJUST_EMBARKED_MOVEMENT"):
                    description = ("Increases Sea Movement by 1.");
                    break;

                case ("STEAM_POWER_ADJUST_EMBARKED_MOVEMENT"):
                    description = ("Increases Sea Movement by 1.");
                    break;

                case ("COMBUSTION_ADJUST_EMBARKED_MOVEMENT"):
                    description = ("Increases Sea Movement by 1.");
                    break;

                case ("PRINTING_ADD_DIPLO_VISIBILITY"):
                    description = ("Allows visibility of foreign lands with appropriate treaty.");
                    break;

                case ("TECH_GRANT_SPY"):
                    description = ("Allows a free spy.");
                    break;

                case ("PRINTING_BOOST_WRITING_TOURISM"):
                    description = ("Increases tourism for Writing Great Works by 200%.");
                    break;

                case ("COMPUTERS_BOOST_ALL_TOURISM"):
                    description = ("Increases tourism for all Great Works by 100%.");
                    break;
                }
                if (!output.Contains(description))
                {
                    output.Add(description);
                }

                /*
                 * //Check whether it is of a name of form "TECHNAME_MODIFIER_DETAILS".
                 * List<ModifierArgument> modifierArguments = ModifierArgumentList.Where(x => x.ModifierId == techModifier.ModifierId).ToList();
                 * if (modifierArguments.Count != 0)
                 * {
                 *  foreach (ModifierArgument argument in modifierArguments)
                 *  {
                 *      string[] argumentString = argument.ModifierId.Split('_');
                 *      if (argumentString[0] == tech.ReferenceName)
                 *      {
                 *          if (argument.Value != null)
                 *          {
                 *              output.AppendLine(Concantenate(argumentString, 1, argumentString.Length, " ") + " by " + argument.Value.ToString());
                 *          }
                 *          else
                 *          {
                 *              output.AppendLine(Concantenate(argumentString, 1, argumentString.Length, " "));
                 *          }
                 *      }
                 *  }
                 * }
                 * else
                 * {
                 *
                 * }
                 */
            }

            return(String.Join(Environment.NewLine, output.ToArray()));
        }
コード例 #2
0
ファイル: BoostHelper.cs プロジェクト: ls612/CFCGen
 public string BoostDetails(Technology owner)
 {
     return("");
 }