本文整理汇总了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();
}
示例2: Block
public Block(Axis axis, Colour colour)
: this(new List<Tuple<Axis, Colour>>()
{
new Tuple<Axis, Colour>(axis, colour)
})
{
}
示例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();
}
示例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();
}
示例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;
}
}
示例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;
}
示例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;
}
示例8: LineDeleted
public void LineDeleted(Colour lineColour)
{
lineCounts.Increment(lineColour);
Messenger<Colour, int>.Broadcast(Events.LineDeleted, lineColour, GetLineCountForColour(lineColour));
GAHelper.LevelLineDeleted(lineColour);
}
示例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;
}
示例10: SetColour
private void SetColour(Colour colour)
{
if(sprite != null)
sprite.SetSprite("LineInner" + colour.ToString());
SetLayer(colour);
}
示例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);
}
示例12: LoadFromStream
protected override void LoadFromStream(Stream stream)
{
base.LoadFromStream(stream);
GraphicsMode = (CompositionMode)stream.ReadBEUInt16();
OpColour = new Colour(stream.ReadBEUInt16(), stream.ReadBEUInt16(), stream.ReadBEUInt16());
}
示例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);
}
示例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);
}
}
示例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);
}