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


C# RoomItem.?.GetRoom方法代码示例

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


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

示例1: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (item?.GetRoom() == null || session?.GetHabbo() == null)
                return;

            RoomUser user = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (user != null)
            {
                if (user.Coordinate == item.Coordinate || user.Coordinate == item.SquareInFront)
                {
                    if (item.InteractingUser != 0)
                        return;

                    item.InteractingUser = user.GetClient().GetHabbo().Id;
                }
                else if (user.CanWalk)
                    user.MoveTo(item.SquareInFront);
            }
        }
开发者ID:sgf,项目名称:Yupi,代码行数:20,代码来源:InteractorTeleport.cs

示例2: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (item?.GetRoom() == null || session?.GetHabbo() == null)
                return;

            RoomUser roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (roomUserByHabbo == null)
                return;

            if (!(roomUserByHabbo.Coordinate == item.Coordinate) && !(roomUserByHabbo.Coordinate == item.SquareInFront))
            {
                roomUserByHabbo.MoveTo(item.SquareInFront);
                return;
            }

            if (item.InteractingUser != 0)
                return;

            item.InteractingUser = roomUserByHabbo.GetClient().GetHabbo().Id;
        }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:21,代码来源:InteractorQuickTeleport.cs

示例3: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (session == null || item?.GetRoom() == null || !hasRights)
                return;

            IWiredItem wired = item.GetRoom().GetWiredHandler().GetWired(item);

            if (wired == null)
                return;

            string extraInfo = wired.OtherString;
            bool flag = wired.OtherBool;
            int delay = wired.Delay/500;
            List<RoomItem> list = wired.Items.Where(roomItem => roomItem != null).ToList();
            string extraString = wired.OtherExtraString;
            string extraString2 = wired.OtherExtraString2;

            switch (item.GetBaseItem().InteractionType)
            {
                case Interaction.TriggerTimer:
                {
                    ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("WiredTriggerMessageComposer"));
                    serverMessage.AppendBool(false);
                    serverMessage.AppendInteger(5);
                    serverMessage.AppendInteger(list.Count);
                    foreach (RoomItem current in list) serverMessage.AppendInteger(current.Id);
                    serverMessage.AppendInteger(item.GetBaseItem().SpriteId);
                    serverMessage.AppendInteger(item.Id);
                    serverMessage.AppendString(extraInfo);
                    serverMessage.AppendInteger(1);
                    serverMessage.AppendInteger(delay);
                    serverMessage.AppendInteger(1);
                    serverMessage.AppendInteger(3);
                    serverMessage.AppendInteger(0);
                    serverMessage.AppendInteger(0);
                    session.SendMessage(serverMessage);
                    return;
                }
                case Interaction.TriggerRoomEnter:
                {
                    ServerMessage serverMessage2 = new ServerMessage(LibraryParser.OutgoingRequest("WiredTriggerMessageComposer"));
                    serverMessage2.AppendBool(false);
                    serverMessage2.AppendInteger(0);
                    serverMessage2.AppendInteger(list.Count);
                    foreach (RoomItem current2 in list) serverMessage2.AppendInteger(current2.Id);
                    serverMessage2.AppendInteger(item.GetBaseItem().SpriteId);
                    serverMessage2.AppendInteger(item.Id);
                    serverMessage2.AppendString(extraInfo);
                    serverMessage2.AppendInteger(0);
                    serverMessage2.AppendInteger(0);
                    serverMessage2.AppendInteger(7);
                    serverMessage2.AppendInteger(0);
                    serverMessage2.AppendInteger(0);
                    serverMessage2.AppendInteger(0);
                    session.SendMessage(serverMessage2);
                    return;
                }
                case Interaction.TriggerGameEnd:
                {
                    ServerMessage serverMessage3 = new ServerMessage(LibraryParser.OutgoingRequest("WiredTriggerMessageComposer"));
                    serverMessage3.AppendBool(false);
                    serverMessage3.AppendInteger(0);
                    serverMessage3.AppendInteger(list.Count);
                    foreach (RoomItem current3 in list) serverMessage3.AppendInteger(current3.Id);
                    serverMessage3.AppendInteger(item.GetBaseItem().SpriteId);
                    serverMessage3.AppendInteger(item.Id);
                    serverMessage3.AppendString(extraInfo);
                    serverMessage3.AppendInteger(0);
                    serverMessage3.AppendInteger(0);
                    serverMessage3.AppendInteger(8);
                    serverMessage3.AppendInteger(0);
                    serverMessage3.AppendInteger(0);
                    serverMessage3.AppendInteger(0);
                    session.SendMessage(serverMessage3);
                    return;
                }
                case Interaction.TriggerGameStart:
                {
                    ServerMessage serverMessage4 = new ServerMessage(LibraryParser.OutgoingRequest("WiredTriggerMessageComposer"));
                    serverMessage4.AppendBool(false);
                    serverMessage4.AppendInteger(0);
                    serverMessage4.AppendInteger(list.Count);
                    foreach (RoomItem current4 in list) serverMessage4.AppendInteger(current4.Id);
                    serverMessage4.AppendInteger(item.GetBaseItem().SpriteId);
                    serverMessage4.AppendInteger(item.Id);
                    serverMessage4.AppendString(extraInfo);
                    serverMessage4.AppendInteger(0);
                    serverMessage4.AppendInteger(0);
                    serverMessage4.AppendInteger(8);
                    serverMessage4.AppendInteger(0);
                    serverMessage4.AppendInteger(0);
                    serverMessage4.AppendInteger(0);
                    session.SendMessage(serverMessage4);
                    return;
                }
                case Interaction.TriggerLongRepeater:
                {
                    ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("WiredTriggerMessageComposer"));
                    serverMessage.AppendBool(false);
                    serverMessage.AppendInteger(5);
//.........这里部分代码省略.........
开发者ID:weslley17w,项目名称:Yupi,代码行数:101,代码来源:InteractorWired.cs


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