本文整理汇总了C#中Tile.getCol方法的典型用法代码示例。如果您正苦于以下问题:C# Tile.getCol方法的具体用法?C# Tile.getCol怎么用?C# Tile.getCol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tile
的用法示例。
在下文中一共展示了Tile.getCol方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getDistance
// returns the amout of rooms between tile a and tile b
private int getDistance(Tile a, Tile b)
{
int retVal = 0;
retVal += Math.Abs (a.getCol () - b.getCol ());
retVal += Math.Abs (a.getRow () - b.getRow ());
return retVal;
}
示例2: placeSpecialRoom
private bool placeSpecialRoom(Tile special)
{
specialRooms.Add (special);
bool ok;
if (special.getTag ().Equals ("S"))
{
special.setPos(floorSize / 2, floorSize / 2);
floor[special.getRow ()][special.getCol ()] = special;
return true;
}
//checks to see if the newly placed tile
//is the minimum distance away from every
//other specially placed tile
int tries = 0;
do
{
if (tries > 50)
{
return false;
}
ok = true;
special.setPos (gen.Next(0, floorSize), gen.Next(0, floorSize));
foreach (Tile i in specialRooms)
{
if (i.Equals(special)) continue;
//UnityEngine.Debug.Log (i.getTag () + special.getTag () + " DISTANCE: " + getDistance (i, special) + " MIN DISTANCE: " + minDistance );
if (getDistance (i, special) < minDistance)
{
ok = false;
break;
}
if (getDistance (i, special) > maxDistance)
{
ok = false;
break;
}
++tries;
}
}while (!ok);
floor[special.getRow ()][special.getCol ()] = special;
return true;
}
示例3: doorPlaced
private bool doorPlaced(Tile tile, int i)
{
int check = -1;
int posRow = tile.getRow ();
int posCol = tile.getCol ();
if (i == 0)
{
check = 2;
--posRow;
}
if (i == 1)
{
check = 3;
++posCol;
}
if (i == 2)
{
check = 0;
++posRow;
}
if (i == 3)
{
check = 1;
--posCol;
}
return floor.getFloor()[posRow][posCol].getPlacedDoor(check);
}