本文整理汇总了C#中RoomItem.GetSquareState方法的典型用法代码示例。如果您正苦于以下问题:C# RoomItem.GetSquareState方法的具体用法?C# RoomItem.GetSquareState怎么用?C# RoomItem.GetSquareState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RoomItem
的用法示例。
在下文中一共展示了RoomItem.GetSquareState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConstructMapForItem
private bool ConstructMapForItem(RoomItem Item, int x, int y)
{
try
{
if (x > (Model.MapSizeX - 1))
{
Model.AddX();
GenerateMaps();
return false;
}
if (y > (Model.MapSizeY - 1))
{
Model.AddY();
GenerateMaps();
return false;
}
if (Model.SqState[x, y] == SquareState.BLOCKED || Model.SqFloorHeight[x, y] > Item.GetZ)
{
Model.OpenSquare(x, y, Item.GetZ);
Model.SetUpdateState();
}
stackmap.AddItem(Item.Id, x, y, Item.GetZ, Item.Height, Item.GetSquareState());
if (mItemHeightMap[x, y] <= Item.TotalHeight)
{
mItemHeightMap[x, y] = Item.TotalHeight - mDynamicModel.SqFloorHeight[Item.GetX, Item.GetY];
mUserItemEffect[x, y] = 0;
switch (Item.GetBaseItem().InteractionType)
{
case InteractionType.pool:
mUserItemEffect[x, y] = 1;
break;
case InteractionType.normslaskates:
mUserItemEffect[x, y] = 2;
break;
case InteractionType.iceskates:
mUserItemEffect[x, y] = 3;
break;
case InteractionType.lowpool:
mUserItemEffect[x, y] = 4;
break;
case InteractionType.haloweenpool:
mUserItemEffect[x, y] = 5;
break;
}
//SwimHalloween
if (Item.GetBaseItem().Walkable)// If this item is walkable and on the floor, allow users to walk here.
{
if (mGameMap[x, y] != 3)
mGameMap[x, y] = 1;
}
else if (Item.GetZ <= (Model.SqFloorHeight[Item.GetX, Item.GetY] + 0.1) && Item.GetBaseItem().InteractionType == Butterfly.HabboHotel.Items.InteractionType.gate && Item.ExtraData == "1") // If this item is a gate, open, and on the floor, allow users to walk here.
{
if (mGameMap[x, y] != 3)
mGameMap[x, y] = 1;
}
else if (Item.GetBaseItem().IsSeat || Item.GetBaseItem().InteractionType == Butterfly.HabboHotel.Items.InteractionType.bed)
{
mGameMap[x, y] = 3;
}
else // Finally, if it's none of those, block the square.
{
if (mGameMap[x, y] != 3)
mGameMap[x, y] = 0;
}
}
// Set bad maps
if (Item.GetBaseItem().InteractionType == Butterfly.HabboHotel.Items.InteractionType.bed)
mGameMap[x, y] = 3;
}
catch (Exception e)
{
Logging.LogException("Error during map generation for room " + room.RoomId + ". Exception: " + e.ToString());
}
return true;
}