本文整理汇总了C#中IRenderable.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IRenderable.GetType方法的具体用法?C# IRenderable.GetType怎么用?C# IRenderable.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRenderable
的用法示例。
在下文中一共展示了IRenderable.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setScene
public static void setScene(IRenderable newScene)
{
if (newScene.GetType() == typeof(UIScene))
{
currentElement = (UIScene)newScene;
}
else
{
currentElement = new UIScene(new IRenderable[] { newScene }, new int[][] { new int[] { 1, 1 } }, new string[] { "" }, newScene.Height + 2, newScene.Width + 2);
}
Console.WindowWidth = currentElement.Width;
Console.WindowHeight = currentElement.Height + 1;
//Console.BufferHeight = currentElement.Height + 1;
//Console.BufferWidth = currentElement.Width + 1;
Console.SetBufferSize(currentElement.Width + 1, currentElement.Height + 1);
}
示例2: EnqueueForRendering
public void EnqueueForRendering(IRenderable obj)
{
char[,] objImage = this.images[obj.GetType()];
int imageRows = objImage.GetLength(0);
int imageCols = objImage.GetLength(1);
MatrixCoords objTopLeft = obj.TopLeft;
int lastRow = Math.Min(objTopLeft.Row + imageRows, this.WorldRows);
int lastCol = Math.Min(objTopLeft.Col + imageCols, this.WorldCols);
for (int row = obj.TopLeft.Row; row < lastRow; row++)
{
for (int col = obj.TopLeft.Col; col < lastCol; col++)
{
if (row >= 0 && col >= 0)
{
this.renderMatrix[row, col] = objImage[row - obj.TopLeft.Row, col - obj.TopLeft.Col];
}
}
}
}
示例3: MatchRenderable
/// <summary>
/// This method checks if the given renderable should be handled by the layer.
/// </summary>
/// <param name="renderable">The renderable.</param>
/// <returns>True if the renderable should be handled by the layer.</returns>
protected virtual bool MatchRenderable(IRenderable renderable)
{
var result = this.RenderableTypes.FirstOrDefault(e => e.IsAssignableFrom(renderable.GetType())) != null;
var namable = renderable as INamable;
if (result == true && String.IsNullOrEmpty(this.StartsWithName) == false)
{
result = namable != null && String.IsNullOrEmpty(namable.Name) == false && namable.Name.StartsWith(this.StartsWithName);
}
return result;
}