• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Values类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Values的典型用法代码示例。如果您正苦于以下问题:C# Values类的具体用法?C# Values怎么用?C# Values使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Values类属于命名空间,在下文中一共展示了Values类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Change

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="variable"></param>
 /// <param name="previousValue"></param>
 /// <param name="newValue"></param>
 public Change(Variables.IVariable variable, Values.IValue previousValue, Values.IValue newValue)
 {
     Variable = variable;
     PreviousValue = previousValue;
     NewValue = newValue;
     Applied = false;
 }
开发者ID:Assmann-Siemens,项目名称:ERTMSFormalSpecs,代码行数:13,代码来源:Change.cs


示例2: ContainsValue

 public bool ContainsValue(Values value)
 {
     foreach (Card card in cards)
         if (card.Value == value)
             return true;
     return false;
 }
开发者ID:HeberAlvarez,项目名称:HeadFirst,代码行数:7,代码来源:Deck.cs


示例3: DoYouHaveAny

 public Deck DoYouHaveAny(Values value)
 {
     Deck cardsIHave = cards.PullOutValues(value);
     textBoxOnForm.Text += Name + " has " + cardsIHave.Count + " "
            + Card.Plural(value) + Environment.NewLine;
     return cardsIHave;
 }
开发者ID:ClarkChen633,项目名称:MyCSharp,代码行数:7,代码来源:Player.cs


示例4: AskForACard

        public void AskForACard(IEnumerable<Player> players, int myIndex, Deck stock, Values value)
        {
            List<Player> _players = (List<Player>)players;

            textBoxOnForm.Content +=  name + " asks if anyone has a " + value + "." + Environment.NewLine;

            int cardsAdded = 0;
            for (int playerIndex = 0; playerIndex < _players.Count; playerIndex++)
            {
                if (playerIndex != myIndex)
                {
                    Deck cardsGiven = _players[playerIndex].DoYouHaveAny(value);
                    if (cardsGiven.Count > 0)
                    {
                        while (cardsGiven.Count > 0)
                        {
                            cards.Add(cardsGiven.Deal());
                            cardsAdded++;
                        }
                    }
                }
            }
            textBoxOnForm.Content += Environment.NewLine;

            if (cardsAdded == 0 && stock.Count > 0)
            {
                textBoxOnForm.Content += name + " has to draw from the stock." + Environment.NewLine;
                cards.Add(stock.Deal());
            }
        }
开发者ID:MarkPThomas,项目名称:HeadFirst-CSharp,代码行数:30,代码来源:Player.cs


示例5: Plural

 public static string Plural(Values value)
 {
     if (value == Values.Six)
         return "Sixes";
     else
         return value.ToString() + "s";
 }
开发者ID:ppaier,项目名称:HFCSharp,代码行数:7,代码来源:Card.cs


示例6: ToListening

        public void ToListening(Command.Endpoint.IInstance commandEndpoint, Values.Version version)
        {
            Context.IListen context = _contextFactory.ForListen(commandEndpoint, version);
            Event.Transition message = _eventFactory.ForStateTransition(context);

            _eventMediator.Publish(message);
        }
开发者ID:jamesleech,项目名称:Harmonize,代码行数:7,代码来源:Transition.cs


示例7: PullOutValues

 public Deck PullOutValues(Values value)
 {
     Deck deckToReturn = new Deck(new Card[] { });
     for (int i = cards.Count - 1; i >= 0; i--)
         if (cards[i].Value == value)
             deckToReturn.Add(Deal(i));
     return deckToReturn;
 }
开发者ID:HeberAlvarez,项目名称:HeadFirst,代码行数:8,代码来源:Deck.cs


示例8: Move

 public Move(Columns column, Rows row, Values value, int score = 0)
     : this()
 {
     Row = row;
     Column = column;
     Value = value;
     Score = score;
 }
开发者ID:ElemarJR,项目名称:Sudoku,代码行数:8,代码来源:Move.cs


示例9: pileColourCards_init

 public void pileColourCards_init(Values value, Colours colour)
 {
     pileColourCards.Clear();
     foreach (Card item in cardsToPlay)
     {
         if (item.colour == colour)
             pileColourCards.Add(item);
     }
 }
开发者ID:Freezedr,项目名称:UNO-WinForms,代码行数:9,代码来源:player.cs


示例10: hasCard

 public IntPtr hasCard(Values value)
 {
     foreach (Card item in cardsToPlay)
     {
         if (item.value == value)
             return new IntPtr(1);
     }
     return new IntPtr(0);
 }
开发者ID:Freezedr,项目名称:UNO-WinForms,代码行数:9,代码来源:player.cs


示例11: GetRandomIISLog

 /// <summary>
 /// Generate a random IISLog
 /// </summary>
 /// <returns></returns>
 public static Values GetRandomIISLog()
 {
     var values = new Values(
         DateTime.UtcNow,
         RandomClientIps[random.Next(RandomClientIps.Count)],
         RandomUris[random.Next(RandomUris.Count)],
         RandomMethods[random.Next(RandomMethods.Count)],
         RandomResponses[random.Next(RandomResponses.Count)]);
     return values;
 }
开发者ID:cleydson,项目名称:hdinsight-storm-examples,代码行数:14,代码来源:IISLogGeneratorSpout.cs


示例12: Script

 public Script(string name, string description, string databaseName, string connectionString, bool wrapInTransaction, Values.Version currentVersion, Values.Version newVersion, string command)
 {
     Name = name;
     Description = description;
     DatabaseName = databaseName;
     ConnectionString = connectionString;
     WrapInTransaction = wrapInTransaction;
     CurrentVersion = currentVersion;
     NewVersion = newVersion;
     Command = command;
 }
开发者ID:binarymash,项目名称:DatabaseScripter,代码行数:11,代码来源:Script.cs


示例13: DoesCardMatch

 public static bool DoesCardMatch(Card cardToCheck, Values value)
 {
     if (cardToCheck.Value == value)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:HeberAlvarez,项目名称:HeadFirst,代码行数:11,代码来源:Card.cs


示例14: HasBook

 public bool HasBook(Values value)
 {
     int NumberOfCards = 0;
     foreach (Card card in cards)
         if (card.Value == value)
             NumberOfCards++;
     if (NumberOfCards == 4)
         return true;
     else
         return false;
 }
开发者ID:ClarkChen633,项目名称:MyCSharp,代码行数:11,代码来源:Deck.cs


示例15: Device

 public Device(Status status, int index, string deviceAddress, string deviceType, string deviceState, Values.SignalStrength signalStrength, Values.LinkQuality linkQuality, Values.BatteryState batteryState, TimeSpan timeSinceLastPacketReceived, int receivedPackets, int sentPackets, params string[] unknown)
 {
     Status = status;
     Index = index;
     DeviceAddress = deviceAddress;
     DeviceType = deviceType;
     DeviceState = deviceState;
     SignalStrength = signalStrength;
     LinkQuality = linkQuality;
     BatteryState = batteryState;
     TimeSinceLastPacketReceived = timeSinceLastPacketReceived;
     ReceivedPackets = receivedPackets;
     SentPackets = sentPackets;
     Unknown = unknown ?? Enumerable.Empty<string>();
 }
开发者ID:Zananok,项目名称:Harmonize,代码行数:15,代码来源:Device.cs


示例16: GetPrice

        public double GetPrice(Values v)
        {
            switch (v)
            {
                case Values.Nine_DollarsNintyNine:
                    return 9.99;
                case Values.Fourteen_Dollars_NintyNine:
                    return 14.99;
                case Values.Ninteen_Dollars_NintyNine:
                    return 19.99;
                default:
                    return 0;

            }
        }
开发者ID:haithemaraissia,项目名称:GEvents,代码行数:15,代码来源:ServingPriceModel.cs


示例17: DoesPickRightPick

        public Values.Pick DoesPickRightPick(Values.Pick pick)
        {
            List<IStratergy> strats = new List<IStratergy>();
            var exampleStrat = Substitute.For<IStratergy>();
            exampleStrat.SuggestedPick.Returns(pick);
            exampleStrat.MinimumConfidence.Returns(0);
            exampleStrat.DifficultyRequired.Returns(0);
            exampleStrat.Confidence.Returns(1);
            strats.Add(exampleStrat);
            var ai = new ArtificalIntelligence(strats);

            ai.LoadPlayersMoves(null);

            return ai.Pick;
        }
开发者ID:gitanamoBay,项目名称:loquacious-guacamole,代码行数:15,代码来源:ArtificialIntelligenceTests.cs


示例18: Create

        /// <summary>
        /// Creates this instance.
        /// </summary>
        /// <returns></returns>
        public static ICollection<Entities.Script> Create(Values.Configuration configuration, Values.ExecutionPlan executionPlan, Domain.Strategies.ConfigInjector configInjector)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (executionPlan == null)
            {
                throw new ArgumentNullException("executionPlan");
            }

            if (configInjector == null)
            {
                throw new ArgumentNullException("configInjector");
            }

            var scripts = new List<Entities.Script>();

            foreach (var scriptName in executionPlan.NameOfScriptsToRun)
            {
                var scriptManifest = configuration.Manifest.GetManifest(scriptName);
                if (scriptManifest == null)
                {
                    //TODO: add errors to scripts
                    var message = string.Format(CultureInfo.InvariantCulture, "Could not find script \"{0}\" in the manifest file.", scriptName);
                    log.Error(message);
                    throw new DatabaseScripterException(ErrorCode.CouldNotFindScriptInManifest, message);
                }

                var environmentConfiguration = configuration.EnvironmentConfigurations.Find(executionPlan.Environment);
                if (environmentConfiguration == null)
                {
                    //TODO: add errors to scripts
                    var message = string.Format(CultureInfo.InvariantCulture, "Could not find environment configuration \"{0}\"", executionPlan.Environment);
                    log.Error(message);
                    throw new DatabaseScripterException(ErrorCode.CouldNotFindEnvironmentConfiguration, message);
                }

                var flatScriptConfiguration = environmentConfiguration.GetFlatConfigurationForScript(scriptName);
                var connectionString = configuration.ConnectionStrings[flatScriptConfiguration.Properties.Find("connection").Value].ConnectionString;

                scripts.Add(CreateScript(flatScriptConfiguration, scriptManifest, configuration, configInjector, connectionString));
            }

            return scripts;
        }
开发者ID:binarymash,项目名称:DatabaseScripter,代码行数:51,代码来源:ScriptFactory.cs


示例19: Plural

 public static string Plural(Values value)
 {
     if (value == Values.Seis)
         return Values.Seis.ToString();
     else
         if (value == Values.As)
             return value.ToString() + "es";
     else
         if (value == Values.Dez)
             return Values.Dez.ToString();
     else
         if (value == Values.Dois)
             return Values.Dois.ToString();
     else
         if (value == Values.Tres)
             return Values.Tres.ToString();
     else
         return value.ToString() + "s";
 }
开发者ID:RonildoSouza,项目名称:Praticas_Use_A_Cabeca_CSharp,代码行数:19,代码来源:Card.cs


示例20: AskForACard

        public void AskForACard(List<Player> players, int myIndex, Deck stock, Values value)
        {
            /*
                Pergunte para os outros jogadores se eles têm uma valor.
                Primeiro, adicione uma linha a TextBox: "João pergunta se alguém tem algum 8".
                Então, percorra a lista de jogadores passada como parâmetro e pergunte a cada um
                deles se ele tem o valor (usando seu método DoYouHaveAny()). Ele deve passar um baralho
                - adicione ao seu. Controle quantas cartas foram adicionadas. Se não houver nenhuma, você
                mesmo terá lidar com uma do stock (que também foi passado como parâmetro) e você terá que
                adicionar uma linha a TextBox: "João tem que pegar uma carta do stock"
            */

            txtBoxOnForm.Text += string.Format("{0} pergunta se alguém tem algum {1}." + Environment.NewLine, Name, value);

            //foreach (Player player in players)
            //{
            //    player.DoYouHaveAny(value);
            //}

            /**/
            int totalCardsGiven = 0;

            for (int i = 0; i < players.Count; i++)
            {
                if (i != myIndex)
                {
                    Player player = players[i];
                    Deck CardsGiven = player.DoYouHaveAny(value);
                    totalCardsGiven += CardsGiven.Count;
                    while (CardsGiven.Count > 0)
                    {
                        deckCards.Add(CardsGiven.Deal());
                    }
                }
            }
            /**/
            if (totalCardsGiven == 0)
            {
                txtBoxOnForm.Text += Name + " deve tirar do stock." + Environment.NewLine;
            }
            deckCards.Add(stock.Deal());
        }
开发者ID:RonildoSouza,项目名称:Praticas_Use_A_Cabeca_CSharp,代码行数:42,代码来源:Player.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ValuesController类代码示例发布时间:2022-05-24
下一篇:
C# ValueWrapper类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap