本文整理匯總了C#中Block.ColorAt方法的典型用法代碼示例。如果您正苦於以下問題:C# Block.ColorAt方法的具體用法?C# Block.ColorAt怎麽用?C# Block.ColorAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Block
的用法示例。
在下文中一共展示了Block.ColorAt方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ColorAt_OutsideBlockWithNegativeValues_ReturnsNull
public void ColorAt_OutsideBlockWithNegativeValues_ReturnsNull()
{
// arrange
b = new Block(shape, Color.White);
// act
Color? response = b.ColorAt(new Vector2(-1, 0));
// assert
Assert.AreEqual(null, response);
}
示例2: ColorAt_UnrotatedAndFalseInShapeLocation_ReturnsNull
public void ColorAt_UnrotatedAndFalseInShapeLocation_ReturnsNull()
{
// arrange
b = new Block(shape, Color.White);
// act
Color? colorAtIndex = b.ColorAt(new Vector2(0, 0));
// assert
Assert.AreEqual(colorAtIndex, null);
}
示例3: ColorAt_Rotated_MapsToOriginalCoordinates
public void ColorAt_Rotated_MapsToOriginalCoordinates()
{
// arrange
// [xx ] b looks like this
// [ xx]
b = new Block(shape, Color.White);
Vector2 testPosition = new Vector2(1, 0);
// act
b.RotateLeft();
Color? colorAfter = b.ColorAt(testPosition);
// assert
Assert.AreEqual(null, colorAfter);
}
示例4: ColorAt_UnrotatedAndTrueInShapeLocation_ReturnsShapeColor
public void ColorAt_UnrotatedAndTrueInShapeLocation_ReturnsShapeColor()
{
//arrange
b = new Block(shape, Color.White);
// [xx ] b looks like this
// [ xx]
//RotationCalculatorStub rotator = new RotationCalculatorStub();
//rotator.PositionToReturn = new Vector2(1, 1);
//b.Rotator = rotator;
// act
Color? colorAtIndex = b.ColorAt(new Vector2(1,1));
// assert
Assert.AreEqual(colorAtIndex, b.ShapeColor);
}