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


C# Room.GetGameMap方法代码示例

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


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

示例1: AllowsExecution

 public bool AllowsExecution(RoomUser user, Room theRoom)
 {
     GenericTriggerWithModes.DoAnimation(this.item);
     int coord = 0;
     Gamemap map = theRoom.GetGameMap();
     Dictionary<int, ThreeDCoord> points;
     bool userInLoop;
     foreach (RoomItem item in items)
     {
         userInLoop = false;
         points = Gamemap.GetAffectedTiles(item.GetBaseItem().Length, item.GetBaseItem().Width, item.GetX, item.GetY, item.Rot);
         foreach (ThreeDCoord coor in points.Values)
         {
             coord = TextHandling.CombineXYCoord(coor.X, coor.Y);
             if (map.GetRoomUsers(coord).Count != 0)
             {
                 userInLoop = true;
                 break;
             }
         }
         if (!userInLoop)
             return false;
         
     }
     return true;
 }
开发者ID:BjkGkh,项目名称:R106,代码行数:26,代码来源:FurniHasUser.cs

示例2: AllowsExecution

        public bool AllowsExecution(RoomUser user, Room theRoom)
        {
            GenericTriggerWithModes.DoAnimation(this.item);
            int coord = 0;
            if (items.Count == 0)
                return true;
            Gamemap map = theRoom.GetGameMap();
            Dictionary<int, ThreeDCoord> points;
            List<RoomItem> itemsOnSquare;
            bool itemFoundOnLoop;
            bool foundOneFurni = false;
            foreach (RoomItem item in items)
            {
                itemFoundOnLoop = false;
                points = Gamemap.GetAffectedTiles(item.GetBaseItem().Length, item.GetBaseItem().Width, item.GetX, item.GetY, item.Rot);
                foreach (ThreeDCoord coor in points.Values)
                {
                    coord = TextHandling.CombineXYCoord(coor.X, coor.Y);
                    itemsOnSquare = map.GetCoordinatedItems(ref coord);
                    foreach (RoomItem itemOntile in itemsOnSquare)
                    {
                        if (itemOntile.Height > item.Height)
                        {
                            if (!allItems)
                                return true;
                            foundOneFurni = true;
                            itemFoundOnLoop = true;
                            break;
                        }
                    }
                    if (itemFoundOnLoop)
                        break;
                }
                if (!itemFoundOnLoop && allItems)
                {
                    return false;
                }

            }
            return foundOneFurni;
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:41,代码来源:FurniHasFurni.cs

示例3: AllowsExecution

        public bool AllowsExecution(RoomUser user, Room theRoom)
        {
            GenericTriggerWithModes.DoAnimation(this.item);
            if (user == null)
                return false;
            Gamemap map = theRoom.GetGameMap();
            Dictionary<int, ThreeDCoord> points;
            foreach (RoomItem item in items)
            {
                item.GetDoubleCoordinates();

                points = Gamemap.GetAffectedTiles(item.GetBaseItem().Length, item.GetBaseItem().Width, item.GetX, item.GetY, item.Rot);
                
                foreach (ThreeDCoord coor in points.Values)
                {   
                    if(map.GetRoomUsers(Formatting.PointToInt(new Point(coor.X, coor.Y))).Count >= 1)
                        return true;
                }
            }
            return false;
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:21,代码来源:TriggerUserIsOnFurni.cs

示例4: InverseDirections

        internal static IComeDirection InverseDirections(Room room, IComeDirection comeWith, int x, int y)
        {
            try
            {
                switch (comeWith)
                {
                    case IComeDirection.Up:
                        return IComeDirection.Down;

                    case IComeDirection.UpRight:
                        if (room.GetGameMap().StaticModel.SqState[x][y] == SquareState.Blocked)
                            return room.GetGameMap().StaticModel.SqState[x + 1][y] == SquareState.Blocked
                                ? IComeDirection.DownRight
                                : IComeDirection.UpLeft;
                        return IComeDirection.DownRight;

                    case IComeDirection.Right:
                        return IComeDirection.Left;

                    case IComeDirection.DownRight:
                        if (room.GetGameMap().StaticModel.SqState[x][y] == SquareState.Blocked)
                            return room.GetGameMap().StaticModel.SqState[x + 1][y] == SquareState.Blocked
                                ? IComeDirection.UpRight
                                : IComeDirection.DownLeft;
                        return IComeDirection.UpRight;

                    case IComeDirection.Down:
                        return IComeDirection.Up;

                    case IComeDirection.DownLeft:
                        return room.GetGameMap().Model.MapSizeX - 1 <= x
                            ? IComeDirection.DownRight
                            : IComeDirection.UpLeft;

                    case IComeDirection.Left:
                        return IComeDirection.Right;

                    case IComeDirection.UpLeft:
                        return room.GetGameMap().Model.MapSizeX - 1 <= x
                            ? IComeDirection.UpRight
                            : IComeDirection.DownLeft;
                }
                return IComeDirection.Null;
            }
            catch
            {
                return IComeDirection.Null;
            }
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:49,代码来源:ComeDirection.cs

示例5: HandleDefaultSave

        internal static void HandleDefaultSave(uint itemID, Room room)
        {
            RoomItem item = room.GetRoomItemHandler().GetItem(itemID);
            if (item == null)
                return;

            InteractionType type = item.GetBaseItem().InteractionType;
            switch (type)
            {
                case InteractionType.actiongivescore:
                    {
                        int points = 0;
                        int games = 0;

                        IWiredTrigger action = new GiveScore(games, points, room.GetGameManager(), itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
                        break;
                    }

                case InteractionType.actionmoverotate:
                    {
                        MovementState movement = MovementState.none;
                        RotationState rotation = RotationState.none;

                        List<RoomItem> items = new List<RoomItem>();
                        int delay = 0;

                        IWiredTrigger action = new MoveRotate(movement, rotation, items, delay, room, room.GetWiredHandler(), itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
                        break;
                    }

                case InteractionType.actionposreset:
                    {
                        List<RoomItem> items = new List<RoomItem>();
                        int delay = 0;

                        IWiredTrigger action = new PositionReset(items, delay, room.GetRoomItemHandler(), room.GetWiredHandler(), itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
                        break;
                    }

                case InteractionType.actionresettimer:
                    {
                        List<RoomItem> items = new List<RoomItem>();
                        int delay = 0;

                        IWiredTrigger action = new TimerReset(room, room.GetWiredHandler(), items, delay, itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
                        break;
                    }

                case InteractionType.actionshowmessage:
                    {
                        string message = string.Empty;

                        IWiredTrigger action = new ShowMessage(message, room.GetWiredHandler(), itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
                        break;
                    }

                case InteractionType.actionteleportto:
                    {
                        List<RoomItem> items = new List<RoomItem>();
                        int delay = 0;

                        IWiredTrigger action = new TeleportToItem(room.GetGameMap(), room.GetWiredHandler(), items, delay, itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
                        break;
                    }

                case InteractionType.actiontogglestate:
                    {
                        List<RoomItem> items = new List<RoomItem>();
                        int delay = 0;

                        IWiredTrigger action = new ToggleItemState(room.GetGameMap(), room.GetWiredHandler(), items, delay, itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
                        break;
                    }

                case InteractionType.conditionfurnishaveusers:
                    {

                        break;
                    }

                case InteractionType.conditionstatepos:
                    {

                        break;
                    }

                case InteractionType.conditiontimelessthan:
                    {

                        break;
                    }

                case InteractionType.conditiontimemorethan:
//.........这里部分代码省略.........
开发者ID:habb0,项目名称:PiciEmulator,代码行数:101,代码来源:WiredSaver.cs

示例6: HandleSave

        internal static void HandleSave(uint itemID, Room room, ClientMessage clientMessage)
        {
            RoomItem item = room.GetRoomItemHandler().GetItem(itemID);
            if (item == null)
                return;

            if (item.wiredHandler != null)
            {
                item.wiredHandler.Dispose();
                item.wiredHandler = null;
            }

            InteractionType type = item.GetBaseItem().InteractionType;
            switch (type)
            {
                case InteractionType.actiongivescore:
                    {
                        clientMessage.AdvancePointer(1);
                        int points = clientMessage.PopWiredInt32();
                        int games = clientMessage.PopWiredInt32();

                        IWiredTrigger action = new GiveScore(games, points, room.GetGameManager(), itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);

                        break;
                    }

                case InteractionType.actionmoverotate:
                    {
                        clientMessage.AdvancePointer(1);
                        MovementState movement = (MovementState)clientMessage.PopWiredInt32();
                        RotationState rotation = (RotationState)clientMessage.PopWiredInt32();

                        clientMessage.AdvancePointer(2);
                        int furniCount;
                        List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
                        int delay = clientMessage.PopWiredInt32();

                        IWiredTrigger action = new MoveRotate(movement, rotation, items, delay, room, room.GetWiredHandler(), itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);

                        break;
                    }

                case InteractionType.actionposreset:
                    {

                        clientMessage.AdvancePointer(3);
                        int furniCount;
                        List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
                        int delay = clientMessage.PopWiredInt32();

                        IWiredTrigger action = new PositionReset(items, delay, room.GetRoomItemHandler(), room.GetWiredHandler(), itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);

                        break;
                    }

                case InteractionType.actionresettimer:
                    {

                        clientMessage.AdvancePointer(3);
                        int furniCount;
                        List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
                        int delay = clientMessage.PopWiredInt32();

                        IWiredTrigger action = new TimerReset(room, room.GetWiredHandler(), items, delay, itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);

                        break;
                    }

                case InteractionType.actionshowmessage:
                    {
                        clientMessage.AdvancePointer(1);
                        string message = clientMessage.PopFixedString();

                        IWiredTrigger action = new ShowMessage(message, room.GetWiredHandler(), itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
                        break;
                    }

                case InteractionType.actionteleportto:
                    {
                        clientMessage.AdvancePointer(3);
                        int furniCount;
                        List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
                        int delay = clientMessage.PopWiredInt32();

                        IWiredTrigger action = new TeleportToItem(room.GetGameMap(), room.GetWiredHandler(), items, delay, itemID);
                        HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);

                        break;
                    }

                case InteractionType.actiontogglestate:
                    {
                        clientMessage.AdvancePointer(3);
                        int furniCount;
                        List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
//.........这里部分代码省略.........
开发者ID:habb0,项目名称:PiciEmulator,代码行数:101,代码来源:WiredSaver.cs

示例7: LoadWiredItem

        internal static void LoadWiredItem(RoomItem item, Room room, IQueryAdapter dbClient)
        {
            InteractionType type = item.GetBaseItem().InteractionType;
            WiredLoaderObject wiredData = WiredLoaderObject.LoadItem(item, room, dbClient);
            
            switch (type)
            {
                case InteractionType.actiongivescore:
                    {
                        IWiredTrigger action = new GiveScore(0, 0, room.GetGameManager(), item, room.GetWiredHandler());
                        action.LoadFromWiredObject(wiredData);
                        HandleItemLoad(action, room.GetWiredHandler(), item);
                        break;
                    }

                case InteractionType.actionmoverotate:
                    {
                        IWiredTrigger action = new MoveRotate(MovementState.none, RotationState.none,new List<RoomItem>(), 0, room, room.GetWiredHandler(), item);
                        action.LoadFromWiredObject(wiredData);
                        HandleItemLoad(action, room.GetWiredHandler(), item);
                        break;
                    }

                case InteractionType.actionposreset:
                    {
                        IWiredTrigger action = new PositionReset(new List<RoomItem>(), 0, room.GetRoomItemHandler(), room.GetWiredHandler(), item);
                        action.LoadFromWiredObject(wiredData);
                        HandleItemLoad(action, room.GetWiredHandler(), item);
                        break;
                    }

                case InteractionType.actionresettimer:
                    {
                        IWiredTrigger action = new TimerReset(room, room.GetWiredHandler(), new List<RoomItem>(), 0, item);
                        action.LoadFromWiredObject(wiredData);
                        HandleItemLoad(action, room.GetWiredHandler(), item);
                        break;
                    }

                case InteractionType.actionshowmessage:
                    {
                        IWiredTrigger action = new ShowMessage(string.Empty, room.GetWiredHandler(), item);
                        action.LoadFromWiredObject(wiredData);
                        HandleItemLoad(action, room.GetWiredHandler(), item);
                        break;
                    }

                case InteractionType.actionteleportto:
                    {
                        IWiredTrigger action = new TeleportToItem(room.GetGameMap(), room.GetWiredHandler(), new List<RoomItem>(), 0, item);
                        action.LoadFromWiredObject(wiredData);
                        HandleItemLoad(action, room.GetWiredHandler(), item);
                        break;
                    }

                case InteractionType.actiontogglestate:
                    {
                        IWiredTrigger action = new ToggleItemState(room.GetGameMap(), room.GetWiredHandler(), new List<RoomItem>(), 0, item);
                        action.LoadFromWiredObject(wiredData);
                        HandleItemLoad(action, room.GetWiredHandler(), item);
                        break;
                    }

                case InteractionType.actionkick:
                    {
                        IWiredTrigger action = new Kick(string.Empty, room.GetWiredHandler(), item);
                        action.LoadFromWiredObject(wiredData);
                        HandleItemLoad(action, room.GetWiredHandler(), item);
                        break;
                    }

                case InteractionType.conditionfurnishaveusers:
                    {
                        IWiredCondition furniHasUsers = new FurniHasUser(item, new List<RoomItem>(), room.GetWiredHandler());
                        furniHasUsers.LoadFromWiredObject(wiredData);
                        HandleConditionLoad(furniHasUsers, item);
                        break;
                    }

                case InteractionType.conditionhasfurnionfurni:
                    {
                        IWiredCondition furniHasUsers = new FurniHasFurni(item, new List<RoomItem>(), room.GetWiredHandler(), false);
                        furniHasUsers.LoadFromWiredObject(wiredData);
                        HandleConditionLoad(furniHasUsers, item);
                        break;
                    }
                case InteractionType.conditionstatepos:
                    {
                        IWiredCondition furnistatepos = new FurniStatePosMatch(item, new List<RoomItem>(), room.GetWiredHandler(),false,false,false);
                        furnistatepos.LoadFromWiredObject(wiredData);
                        HandleConditionLoad(furnistatepos, item);
                        break;
                    }

                case InteractionType.conditiontimelessthan:
                    {
                        IWiredCondition timeLessThan = new LessThanTimer(0, room, item, room.GetWiredHandler());
                        timeLessThan.LoadFromWiredObject(wiredData);
                        HandleConditionLoad(timeLessThan, item);
                        break;
//.........这里部分代码省略.........
开发者ID:BjkGkh,项目名称:R106,代码行数:101,代码来源:WiredLoader.cs

示例8: onUserFurniCollision

        public bool onUserFurniCollision(Room Instance, Item Item)
        {
            if (Instance == null || Item == null)
                return false;

            foreach (Point Point in Item.GetSides())
            {
                if (Instance.GetGameMap().SquareHasUsers(Point.X, Point.Y))
                {
                    List<RoomUser> Users = Instance.GetGameMap().GetRoomUsers(Point);
                    if (Users != null && Users.Count > 0)
                    {
                        foreach (RoomUser User in Users.ToList())
                        {
                            if (User == null)
                                continue;

                            Item.UserFurniCollision(User);
                        }
                    }
                    else
                        continue;
                }
                else
                    continue;
            }

            return true;
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:29,代码来源:WiredComponent.cs

示例9: InverseDirections

		internal static ComeDirection InverseDirections(Room room, ComeDirection comeWith, int x, int y)
		{
			checked
			{
				ComeDirection result;
				try
				{
					if (comeWith == ComeDirection.UP)
					{
						result = ComeDirection.DOWN;
					}
					else
					{
						if (comeWith == ComeDirection.UP_RIGHT)
						{
							if (room.GetGameMap().StaticModel.SqState[x, y] == SquareState.BLOCKED)
							{
								if (room.GetGameMap().StaticModel.SqState[x + 1, y] == SquareState.BLOCKED)
								{
									result = ComeDirection.DOWN_RIGHT;
								}
								else
								{
									result = ComeDirection.UP_LEFT;
								}
							}
							else
							{
								result = ComeDirection.DOWN_RIGHT;
							}
						}
						else
						{
							if (comeWith == ComeDirection.RIGHT)
							{
								result = ComeDirection.LEFT;
							}
							else
							{
								if (comeWith == ComeDirection.DOWN_RIGHT)
								{
									if (room.GetGameMap().StaticModel.SqState[x, y] == SquareState.BLOCKED)
									{
										if (room.GetGameMap().StaticModel.SqState[x + 1, y] == SquareState.BLOCKED)
										{
											result = ComeDirection.UP_RIGHT;
										}
										else
										{
											result = ComeDirection.DOWN_LEFT;
										}
									}
									else
									{
										result = ComeDirection.UP_RIGHT;
									}
								}
								else
								{
									if (comeWith == ComeDirection.DOWN)
									{
										result = ComeDirection.UP;
									}
									else
									{
										if (comeWith == ComeDirection.DOWN_LEFT)
										{
											if (room.GetGameMap().Model.MapSizeX - 1 <= x)
											{
												result = ComeDirection.DOWN_RIGHT;
											}
											else
											{
												result = ComeDirection.UP_LEFT;
											}
										}
										else
										{
											if (comeWith == ComeDirection.LEFT)
											{
												result = ComeDirection.RIGHT;
											}
											else
											{
												if (comeWith == ComeDirection.UP_LEFT)
												{
													if (room.GetGameMap().Model.MapSizeX - 1 <= x)
													{
														result = ComeDirection.UP_RIGHT;
													}
													else
													{
														result = ComeDirection.DOWN_LEFT;
													}
												}
												else
												{
													result = ComeDirection.NULL;
												}
											}
//.........这里部分代码省略.........
开发者ID:kessiler,项目名称:habboServer,代码行数:101,代码来源:_ComeDirection.cs


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