本文整理汇总了C#中Room.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Room.ToString方法的具体用法?C# Room.ToString怎么用?C# Room.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlaceRoomOnPosition
void PlaceRoomOnPosition(float x, float y, Room.Type roomType)
{
Vector3 pos = new Vector3(20*x+10,20*y+10,0);
GameObject room = roomList[0].room;
switch (roomType)
{
case Room.Type._1x2:
{
room = roomList[1].room;
break;
}
case Room.Type._2x1:
{
room = roomList[2].room;
break;
}
case Room.Type._2x2:
{
room = roomList[3].room;
break;
}
}
GameObject tile = Instantiate(room, pos, transform.rotation) as GameObject;
tile.transform.parent = RoomContainer.transform;
tile.transform.name = roomType.ToString() + "_" + x + "," + y;
}
示例2: findConnectedRooms
public List<Room> findConnectedRooms(Room room, bool logger = false)
{
Debug.logger.logEnabled = logger;
List<Room> ret = new List<Room>();
ret.Add(room);
var visited = new List<Pathway>();
var searchlist = new List<Pathway>(room.ConnectingPathways);
Debug.logger.Log("Search Start",string.Format("{0} {1}",room.ToString(),room.ConnectingPathways.Length));
while (searchlist.Count != 0) {
var current = searchlist[0];
Debug.logger.Log("Current", current.ToString());
visited.Add(current);
if (current.ConnectingRooms.Length != 0) {
var find = Array.FindAll(current.ConnectingRooms, r => !ret.Contains(r));
foreach (Room r in find) {
Debug.logger.Log("Room", r.ToString());
searchlist.AddRange(Array.FindAll(r.ConnectingPathways, p => !visited.Contains(p)&&!searchlist.Contains(p)));
}
ret.AddRange(find);
}
searchlist.AddRange(current.ConnectingPathways);
searchlist.RemoveAll(p=> visited.Contains(p));
}
Debug.logger.logEnabled = true;
return ret;
}
示例3: DeleteRoom
public bool DeleteRoom(Room room)
{
if (room == null) return false;
return DeleteRoom(room.ToString());
}