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


C# Colour类代码示例

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


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

示例1: WhenGivenDifferentValues_ReturnsFalse

            public void WhenGivenDifferentValues_ReturnsFalse()
            {
                var x = new Colour(0f, 1f, 0f);
                var y = new Colour(360f, 1f, 1f);

                x.Equals(y).Should().BeFalse();
            }
开发者ID:BraveSirAndrew,项目名称:mercury-particle-engine,代码行数:7,代码来源:ColourTests.cs

示例2: Block

 public Block(Axis axis, Colour colour)
     : this(new List<Tuple<Axis, Colour>>()
     {
         new Tuple<Axis, Colour>(axis, colour)
     })
 {
 }
开发者ID:JakeColtman,项目名称:Kill-Sudoku-Solver,代码行数:7,代码来源:Block.cs

示例3: Player

        /// <summary>
        /// Player
        /// </summary>
        /// <param name="aPlayerName"></param>
        /// <param name="aLocation"></param>
        public Player(string aPlayerName, Location3i aLocation)
            : base()
        {
            // Create the players key-chain
            KeyChain = new KeyChain();

            // Create the players wallet.
            Wallet = new Currency(0);

            G = '@';
            Name = aPlayerName;
            Location = aLocation;
            C = new Colour() { FG = ConsoleColor.Gray };
            Stats = new Stats()
            {
                Agility = 2,
                Charisma = 4,
                Endurance = 7,
                Intelligence = 7,
                Luck = 4,
                Perception = 2,
                Strength = 7,
            };

            Initialize();
        }
开发者ID:exallium,项目名称:DotNetHack,代码行数:31,代码来源:Player.cs

示例4: WhenGivenEqualValues_ReturnsTrue

            public void WhenGivenEqualValues_ReturnsTrue()
            {
                var x = new Colour(360f, 1f, 1f);
                var y = new Colour(360f, 1f, 1f);

                x.Equals(y).Should().BeTrue();
            }
开发者ID:BraveSirAndrew,项目名称:mercury-particle-engine,代码行数:7,代码来源:ColourTests.cs

示例5: DoHook

        void DoHook()
        {
            var creature = (this.ReceivedEvent as Hook).Creature;
            var colour = (this.ReceivedEvent as Hook).Colour;

            if (this.TotalRendezvous == 0)
            {
                this.TotalStoppedCreatures++;
                this.DoPostRoundProcessing();
                return;
            }

            if (this.FirstHooker == null)
            {
                this.FirstHooker = creature;
                this.FirstColour = colour;
            }
            else
            {
                this.Send(this.FirstHooker, new Hook(creature, colour));
                this.Send(creature, new Hook(this.FirstHooker, this.FirstColour));
                this.FirstHooker = null;
                this.TotalRendezvous = this.TotalRendezvous - 1;
            }
        }
开发者ID:yonglehou,项目名称:PSharp,代码行数:25,代码来源:Broker.cs

示例6: MatchColour

        private ConsoleColor MatchColour(Colour colour)
        {
            ConsoleColor matchColour;

            switch (colour)
            {
                case Colour.Red:
                    matchColour = ConsoleColor.Red;
                    break;
                case Colour.Green:
                    matchColour = ConsoleColor.Green;
                    break;
                case Colour.Blue:
                    matchColour = ConsoleColor.Blue;
                    break;
                case Colour.Yellow:
                    matchColour = ConsoleColor.Yellow;
                    break;
                case Colour.Black:
                    matchColour = ConsoleColor.Black;
                    break;
                default:
                    throw new ArgumentException("Unknown colour type.");
            }

            return matchColour;
        }
开发者ID:Anubis-Black,项目名称:TeamIodine,代码行数:27,代码来源:ConsoleRenderer.cs

示例7: Potion

 /// <summary>
 /// Creates a (base) instance of Potion/
 /// </summary>
 /// <param name="aType">The type of potion</param>
 /// <param name="aName">The name of the potion.</param>
 /// <param name="aColor">The color of the potion.</param>
 public Potion(PotionType aPotionType, PotionStrength aPotionStrength,
     string aName, Colour aColor)
     : base(ItemType.Potion, aName, '!', aColor)
 {
     PotionType = aPotionType;
     PotionStrength = aPotionStrength;
 }
开发者ID:exallium,项目名称:DotNetHack,代码行数:13,代码来源:Potion.cs

示例8: LineDeleted

        public void LineDeleted(Colour lineColour)
        {
            lineCounts.Increment(lineColour);

            Messenger<Colour, int>.Broadcast(Events.LineDeleted, lineColour, GetLineCountForColour(lineColour));
            GAHelper.LevelLineDeleted(lineColour);
        }
开发者ID:philjhale,项目名称:Rebounder,代码行数:7,代码来源:LineCountManager.cs

示例9: Armour

 public Armour(string aName, char aGlyph, Colour aColour, Location3i l,
     ArmourLocation aArmourLocation)
     : base(ItemType.Armour, aName, aGlyph, aColour, l)
 {
     ArmourLocation = aArmourLocation;
     Condition = 100;
 }
开发者ID:exallium,项目名称:DotNetHack,代码行数:7,代码来源:Armour.cs

示例10: SetColour

        private void SetColour(Colour colour)
        {
            if(sprite != null)
                sprite.SetSprite("LineInner" + colour.ToString());

            SetLayer(colour);
        }
开发者ID:philjhale,项目名称:Rebounder,代码行数:7,代码来源:LineMiddle.cs

示例11: ExaggerateColour

 private Colour ExaggerateColour(int iterations, Colour mean)
 {
     var redness = Extremise(mean.Redness, iterations);
     var greenness = Extremise(mean.Greenness, iterations);
     var blueness = Extremise(mean.Blueness, iterations);
     return new Colour(redness, greenness, blueness);
 }
开发者ID:EJLarcs,项目名称:chromesthesia,代码行数:7,代码来源:Calculate.cs

示例12: LoadFromStream

        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            GraphicsMode = (CompositionMode)stream.ReadBEUInt16();
            OpColour = new Colour(stream.ReadBEUInt16(), stream.ReadBEUInt16(), stream.ReadBEUInt16());
        }
开发者ID:heksesang,项目名称:bmff,代码行数:7,代码来源:VideoMediaHeaderBox.cs

示例13: DrawBox

 public void DrawBox(int x, int y, int height, int width, Colour colour)
 {
     DrawLine(x, y, (x + width), y, colour);
     DrawLine((x + width), y, (x + width), (y + height), colour);
     DrawLine((x + width), (y + height), x, (y + height), colour);
     DrawLine(x, (y + height), x, y, colour);
 }
开发者ID:ke2083,项目名称:KOS,代码行数:7,代码来源:Layer.cs

示例14: Plot

 public void Plot(char character, int x, int y, Layer layer, Colour colour)
 {
     var characterLines = charmap[character] as Line[];
     for (int i = 0; i < characterLines.Length; i++)
     {
         layer.DrawLine(characterLines[i].Start.X + x, characterLines[i].Start.Y + y, characterLines[i].End.X + x, characterLines[i].End.Y + y, colour);
     }
 }
开发者ID:ke2083,项目名称:KOS,代码行数:8,代码来源:Font.cs

示例15: SetButtonVisibilityForColour

        private void SetButtonVisibilityForColour(Colour colour)
        {
            if(lineCounts.GetLineCountForColour(colour) > 0)
                return;

            var button = buttons.Where(x => x.Colour == colour).Single();
            NGUITools.SetActive(button.gameObject, false);
        }
开发者ID:philjhale,项目名称:Rebounder,代码行数:8,代码来源:RemainingLinesMenu.cs


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