当前位置: 首页>>代码示例>>C#>>正文


C# RoomItem.GetDoubleCoordinates方法代码示例

本文整理汇总了C#中RoomItem.GetDoubleCoordinates方法的典型用法代码示例。如果您正苦于以下问题:C# RoomItem.GetDoubleCoordinates方法的具体用法?C# RoomItem.GetDoubleCoordinates怎么用?C# RoomItem.GetDoubleCoordinates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RoomItem的用法示例。


在下文中一共展示了RoomItem.GetDoubleCoordinates方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddItemToMap

		internal bool AddItemToMap(RoomItem Item, bool handleGameItem)
		{
			if (handleGameItem)
			{
				if (room.GotWired() && WiredUtillity.TypeIsWired(Item.GetBaseItem().InteractionType))
					room.GetWiredHandler().AddFurniture(Item);

				AddSpecialItems(Item);

				switch (Item.GetBaseItem().InteractionType)
				{
					case InteractionType.footballgoalred:
					case InteractionType.footballcounterred:
					case InteractionType.banzaiscorered:
					case InteractionType.freezeredcounter:
					case InteractionType.freezeredgate:
						{
							room.GetGameManager().AddFurnitureToTeam(Item, Games.Team.red);
							break;
						}
					case InteractionType.footballgoalgreen:
					case InteractionType.footballcountergreen:
					case InteractionType.banzaiscoregreen:
					case InteractionType.freezegreencounter:
					case InteractionType.freezegreengate:
						{
							room.GetGameManager().AddFurnitureToTeam(Item, Games.Team.green);
							break;
						}
					case InteractionType.footballgoalblue:
					case InteractionType.footballcounterblue:
					case InteractionType.banzaiscoreblue:
					case InteractionType.freezebluecounter:
					case InteractionType.freezebluegate:
						{
							room.GetGameManager().AddFurnitureToTeam(Item, Games.Team.blue);
							break;
						}
					case InteractionType.footballgoalyellow:
					case InteractionType.footballcounteryellow:
					case InteractionType.banzaiscoreyellow:
					case InteractionType.freezeyellowcounter:
					case InteractionType.freezeyellowgate:
						{
							room.GetGameManager().AddFurnitureToTeam(Item, Games.Team.yellow);
							break;
						}
					case InteractionType.freezeexit:
						{
							room.GetFreeze().ExitTeleport = Item;
							break;
						}
					case InteractionType.roller:
						{
							if (!room.GetRoomItemHandler().mRollers.ContainsKey(Item.Id))
								room.GetRoomItemHandler().mRollers.Add(Item.Id, Item);
							break;
						}
				}
			}

			if (Item.GetBaseItem().Type != 's')
				return true;

			foreach (int coord in Item.GetDoubleCoordinates())
			{
				AddCoordinatedItem(Item, coord);
			}

			if (Item.GetX > (Model.MapSizeX - 1))
			{
				Model.AddX();
				GenerateMaps();
				return false;
			}

			if (Item.GetY > (Model.MapSizeY - 1))
			{
				Model.AddY();
				GenerateMaps();
				return false;
			}

			foreach (Point coord in Item.GetCoords)
			{
				if (!ConstructMapForItem(Item, coord.X, coord.Y))
					return false;
			}

			return true;
		}
开发者ID:BjkGkh,项目名称:R106,代码行数:91,代码来源:Gamemap.cs

示例2: RemoveFromMap

		internal bool RemoveFromMap(RoomItem item, bool handleGameItem)
		{
			if (handleGameItem)
				RemoveSpecialItem(item);

			if (room.GotSoccer())
				room.GetSoccer().onGateRemove(item);

			bool isRemoved = false;
			foreach (int coord in item.GetDoubleCoordinates())
			{
				if (RemoveCoordinatedItem(item, coord))
					isRemoved = true;
			}

			Hashtable items = new Hashtable();
			int point;
			foreach (Point tile in item.GetCoords)
			{
				point = Formatting.PointToInt(tile);
				if (mCoordinatedItems.ContainsKey(point))
				{
					List<RoomItem> __items = (List<RoomItem>)mCoordinatedItems[point];
					if (!items.ContainsKey(tile))
					{
						items.Add(tile, __items);
					}
				}
				SetDefaultValue(tile.X, tile.Y);
			}

			foreach (Point coord in items.Keys)
			{
				if (!items.ContainsKey(coord))
					continue;

				List<RoomItem> _items = (List<RoomItem>)items[coord];

				foreach (RoomItem _item in _items)
				{
                    foreach (Point ___coord in _item.GetCoords)
                        ConstructMapForItem(_item, ___coord.X, ___coord.Y);
					    //ConstructMapForItem(_item, _item.GetX, _item.GetY);
				}
			}

			items.Clear();
			items = null;
			return isRemoved;
		}
开发者ID:BjkGkh,项目名称:R106,代码行数:50,代码来源:Gamemap.cs


注:本文中的RoomItem.GetDoubleCoordinates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。